我正在尝试将项目scp到我的EC2实例上。我有我的.pem键,但scp似乎无法找到我的密钥,尽管它给了它完整的地址。任何见解?
[ec2-user@ip-172-31-19-174 ~]$ scp -i /Users/.../my_keys.pem -r /Users/.../project [email protected]:~/
Warning: Identity file /Users/.../my_keys.pem not accessible: No such file or directory.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
lost connection
顺便说一句,我可以通过ssh进入实例
ssh -i /Users/.../my_keys.pem ec2-user@[email protected]
(虽然有以下警告)
The authenticity of host '[host_name]' can't be established.
ECDSA key fingerprint is [fingerprint_name].
Are you sure you want to continue connecting (yes/no)?
您是否尝试将本地PC中的内容scp到AWS实例中?如果你看起来你正在从你的ec2实例而不是你的本地运行你的scp:
[ec2-user@ip-172-31-19-174 ~]$ scp -i /Users/.../my_keys.pem -r /Users/.../project [email protected]:~/
注意你的行的开头:[ec2-user @ ip-172-31-19-174~]
您应该从本地计算机上执行scp,如果这是您要实现的目标。
简而言之,您已经ssh到服务器上了。