我遇到一个奇怪的问题。 我有多个我正在pipe理的ec2实例,我不得不将一些隐藏的文件从Ubuntu复制到Amazon Linux实例。
要走的路上应该是rsync AFAIK,因为pem文件在我的本地机器上 – Mac OS X 10.10.5 – 我做了我必须做的事情:
rsync -rave "ssh -i keyfile1.pem" ubuntu@firstmachineip:folder_inside_home/ local_folder/
接着
rsync -rave "ssh -i keyfile2.pem" local_folder/ ec2-user@secondmachineip:
这两个都成功了。
问题是,当再次sshing到第二台机器(第一个罚款)给我的模糊
Permission denied (publickey).
请注意,在rsyncing的连接工作没有问题之前,即使钥匙文件曾经损坏,我从备份恢复它,照顾了chmod 600 keyfile2.pem ,甚至尝试过chmod 400 keyfile2.pem
在确定指纹已知之后,我还将保留ssh -vvv -i keyfile2.pem ec2-user@secondmachineip输出的最后部分:
debug1: Host 'secondmachineip' is known and matches the RSA host key. debug1: Found key in /Users/thevet/.ssh/known_hosts:10 debug2: bits set: 494/1024 debug1: ssh_rsa_verify: signature correct debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: keyfile2.pem (0x0), explicit debug1: Authentications that can continue: publickey debug3: start over, passed a different list publickey debug3: preferred publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Trying private key: keyfile2.pem debug1: read PEM private key done: type RSA debug3: sign_and_send_pubkey: RSA *here goes the rsa* debug2: we sent a publickey packet, wait for reply 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).
任何线索究竟发生了什么? 我无能为力
提前致谢