I have Cygwin installed on Windows 7 and use it for SSHing into various machines.
I just created an AWS account and generated public/private keys for my free tier instance. I downloaded a PEM file (private key) and am now trying to SSH into the node with it. According to the AMIs docs, the AMI I am using doesn't use a password and 100% relies on SSH like so: ssh [email protected]
.
This means I need the PEM file "installed properly", but I'm not sure how to do this, especially on a Windows/Cygwin stack. Under ~/.ssh
I see the following:
C:/Users/myuser/.ssh/
id_rsa
id_rsa.pub
known_hosts
I tried simply copying the PEM file into .ssh/
but that is not working. Any ideas?
I don't know if cygwin uses the same client as linux, but there are a number of things missing from your question. But I'll give you some suggestions.
What was the error message you got that leads you to believe that copying the file into .ssh isn't working? I'd guess that you need the right permissions on the .pem file - the .ssh directory should be 700, and the pem file should be 600. What does ls -la ~/.ssh
look like? In any case, try:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*pem
Next, you have to make sure you log in with the right user:
ssh -i ~/.ssh/whatever.pem username@ec2-ip-or-hostname
The user name will be different depending on the AMI - for example, the Amazon Linux AMI uses ec2-user, while some older RedHat AMIs still use root, and I think ubuntu use ubuntu@
Finally, you have to make sure that the security group assigned to the instance have port 22 open to your IP address.