gpt4 book ai didi

ssh - 无法 ssh 到 AWS EC2 : Identity file not accessible

转载 作者:行者123 更新时间:2023-12-03 07:28:01 28 4
gpt4 key购买 nike

我无法通过 ssh 连接到我的 EC2 服务器并收到错误:

ssh -i /Users/Skeniver/Keepass/skeniver.pem ubuntu@xx.xxx.xx.xxx

Identity file /Users/Skeniver/Keepass/skeniver.pem not accessible: No such file or directory

该文件肯定在目录中,并且我已将目录更改为 755,将文件更改为 600:

drwxr-xr-x  14 Skeniver  staff    476 28 Nov  2012 Keepass
-rw------- 1 Skeniver staff 1696 5 Oct 2012 skeniverkey.pem

我很确定这是一个权限问题,但不知道为什么......

这是使用 -v 的 ssh 命令的输出,以防有任何用处:

Warning: Identity file /Users/Skeniver/Keepass/skeniver.pem not accessible: No such file or directory.
OpenSSH_5.2p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to xx.xxx.xx.xxx [xx.xxx.xx.xxx] port 22.
debug1: Connection established.
debug1: identity file /Users/Skeniver/.ssh/identity type -1
debug1: identity file /Users/Skeniver/.ssh/id_rsa type 1
debug1: identity file /Users/Skeniver/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'xx.xxx.xx.xxx' is known and matches the RSA host key.
debug1: Found key in /Users/Skeniver/.ssh/known_hosts:8
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/Skeniver/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/Skeniver/.ssh/identity
debug1: Trying private key: /Users/Skeniver/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).

最佳答案

您需要身份文件才能登录 Box。使用命令:

ssh -i (identity_file) username@hostname"

这对我有用。仅写入文件名(不带任何斜杠),这与要求您输入的 Amazon EC2 教程不同:

ssh -i /path/key_pair.pem ec2-user@public_dns_name

将身份文件放入主目录的 .ssh(隐藏)文件夹后,它对我有用。要查看主页上的隐藏文件夹,请使用 ctrl+h

关于ssh - 无法 ssh 到 AWS EC2 : Identity file not accessible,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17038015/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com