Sarmen (5) [Avatar] Offline
#1
Hello!

I have been working through the firewall example and when I try to enter this code with $PathToKey and $BastionHostPublicName properly listed with the appropriate input:
ssh -i $PathToKey/mykey.pem -A ec2-user@$BastionHostPublicName


[ec2-user@ip-172-31-0-22 ~]$ ssh --i C:/Users/"SARMEN LAPTOP"/Desktop/"AMAZON WEB SERVICES"/opsworkskey.pem -A ec2-user@ec2-107-21-181-180.compute-1.amazonaws.com
ssh: Could not resolve hostname C:/Users/SARMEN LAPTOP/Desktop/AMAZON WEB SERVICES/opsworkskey.pem: Name or service not known
[ec2-user@ip-172-31-0-22 ~]$ ssh -i C:/Users/"SARMEN LAPTOP"/Desktop/"AMAZON WEB SERVICES"/opsworkskey.pem -A ec2-user@ec2-107-21-181-180.compute-1.amazonaws.com
Warning: Identity file C:/Users/SARMEN LAPTOP/Desktop/AMAZON WEB SERVICES/opsworkskey.pem not accessible: No such file or directory.
The authenticity of host 'ec2-107-21-181-180.compute-1.amazonaws.com (172.31.0.22)' can't be established.
ECDSA key fingerprint is 3f:28:ee:35:7d:f0:de:38:87:c1:20:f6:27:c6:d9:3f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-107-21-181-180.compute-1.amazonaws.com,172.31.0.22' (ECDSA) to the list of known hosts.
Permission denied (publickey).

I've entered the path in many ways and nothing seems to work.

Any ideas out there?

Best,
-Sarmen
Sarmen (5) [Avatar] Offline
#2
Can anyone give me a pointer as to why I am unable to connect to the bastion host/authenticate?
Sarmen (5) [Avatar] Offline
#3
Do any of the AWS specialists know how to get around the issue?
Michael Wittig (81) [Avatar] Offline
#4
Hi Sarmen,

1. I don't understand how your example relates to chapter 6 which is not about Ops Works but about the bastion host pattern. Can you explain what you try to achieve?
2. It looks like you are on Windows? We suggest to use Putty on Windows.
3. It looks like that the private key you use does not match with the public key on the server. ssh comes with the -v argument to show more verbose ouput which might helo to debug the problem.

Thanks
Michael
Sarmen (5) [Avatar] Offline
#5
Michael Wittig wrote:Hi Sarmen,

1. I don't understand how your example relates to chapter 6 which is not about Ops Works but about the bastion host pattern. Can you explain what you try to achieve?
2. It looks like you are on Windows? We suggest to use Putty on Windows.
3. It looks like that the private key you use does not match with the public key on the server. ssh comes with the -v argument to show more verbose ouput which might helo to debug the problem.

Thanks
Michael


Thanks for the reply, Michael.

The example is from Chapter 6 page 172. I am doing the bastion host example with firewall5.json being used as the stack template. I am using putty/ssh. I am trying to access the bastion host but am not being authenticated with my key. The fact that the name of the key is "opsworkskey" is moot I believe.

Any suggestions?
Sarmen (5) [Avatar] Offline
#6
Basically the files on my system are not being recognized when I search for them even though I can successfully change default directory to the folder that contains the file.
Michael Wittig (81) [Avatar] Offline
#7
Hi Sarmen,

to debug this problem I need
1.) screenshot of the KeyPairs section in EC2
2.) screenshot of the EC2 Instance details of the bastion host
3.) screenshots of all the putty Settings you enter while connecting

Thanks
Michael