我目前正在使用 ssh 连接我的远程 aws 实例,它是 ubuntu 。起初我可以完美地连接到它。但是,在我将 ec2 实例的 ssh 密钥(.pem 文件)从下载移动到我自己笔记本电脑上的 .ssh 文件夹后,它显示Could not resolve hostname mypath/myssh.pem provided, or not known
. 我很确定用户名和服务器名称没有问题。有什么我想设置的吗?
此外,虽然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 aws
ssh_config 中设置了。在使用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).