0

I am currently using ssh to connect my remote aws instance which is ubuntu .At first I could connect to it perfectly. However, after I move the ssh key(.pem file) of ec2 instance from Download to .ssh folder on my own laptop, it shows that Could not resolve hostname mypath/myssh.pem provided, or not known. I am pretty sure that nothing wrong over username and the server name. Is there something that I am missing to set ?
Besides, while ssh -v it shows that debug1: Trying private key: Mypathtokey/my.pem debug1: Authentications that can continue: publickey debug1: No more authentication methods to try.

edit my command

ssh -i ~/.ssh/my.pem ubuntu@myawsDNSserver.com

I also set ssh aws in ssh_config. while using ssh -vvv aws, it shows that

debug1: Next authentication method: publickey
debug1: Trying private key: /Users/mypath/.ssh/ssh.pem
debug2: storing passphrase in keychain
debug3: Search for existing item with query: {
    acct = "/Users/mypath/.ssh/ssh.pem";
    agrp = "com.apple.ssh.passphrases";
    class = genp;
    labl = "SSH: /Users/mypath/.ssh/ssh.pem";
    nleg = 1;
    "r_Ref" = 1;
    svce = OpenSSH;
}
debug3: Item already exists in the keychain, updating.
debug3: sign_and_send_pubkey: RSA SHA256: my rsa sha256 keyvalue 
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
EEEEEric
  • 77
  • 3
  • 9
  • Show command that you are using. – Justinas Nov 15 '16 at 08:24
  • *" after I move my ssh key to another folder"* ... which key? ON server or client? Why? – Jakuje Nov 15 '16 at 08:33
  • I move the ssh key(.pem file) of ec2 instance from Download to .ssh folder on my own laptop because I tried to making a connection to ec2 instance at my Downloads file at first – EEEEEric Nov 15 '16 at 08:37

1 Answers1

0

Did you check the permission of your .pem file ? try changing it to 600 and connect. Hope that will solve the problem.