我目前正在使用ssh连接我的远程aws实例,它是ubuntu一开始我能很好地理解它。但是,在我移动ssh密钥(。在我自己的笔记本电脑上,从下载的ec2实例的. pem文件)到.ssh文件夹,它显示Could not resolve hostname mypath/myssh.pem provided, or not known
. pem文件。我很确定,没有错误的用户名和服务器名称。有什么我没有设置的吗?
此外,ssh -v
表明debug1: Trying private key: Mypathtokey/my.pem
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
编辑命令
ssh -i ~/.ssh/my.pem ubuntu@myawsDNSserver.com
我还在ssh_config中设置了ssh aws
。当使用ssh -vvv aws
时,它显示
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).
是否检查了.pem文件的权限?尝试将其更改为600并连接。希望这能解决问题。