Amazon EC2部署用户 - 权限被拒绝(公钥)

时间:2016-12-07 17:51:38

标签: amazon-web-services ssh amazon-ec2 ssh-keys

我正在尝试将rails应用程序部署到我的amazon EC2实例。我刚刚创建了它,我采取的唯一操作是创建部署用户,我将用于capistrano。一切都运行正常,但我不能直接为该用户ssh,但只能在我的ubuntu用户。 我用-v param执行了ssh,所以我得到了输出:

ssh -v -i ~/Pems/hybrazil-impulso.pem deploy@35.160.22.104
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 35.160.22.104 [35.160.22.104] port 22.
debug1: Connection established.
debug1: identity file /home/ronanlopes/Pems/hybrazil-impulso.pem type -1
debug1: identity file /home/ronanlopes/Pems/hybrazil-impulso.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-sha1-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA bb:b3:01:95:2a:da:b5:ef:26:7c:06:51:36:f8:11:93
debug1: Host '35.160.22.104' is known and matches the ECDSA host key.
debug1: Found key in /home/ronanlopes/.ssh/known_hosts:21
debug1: ssh_ecdsa_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 RSA public key: lopesronanufsj@gmail.com
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/ronanlopes/Pems/hybrazil-impulso.pem
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

我在这里看到了类似的问题:AWS SSH connection error: Permission denied (publickey),但这些答案都没有对我有用......任何想法如何解决?谢谢!

编辑:

创建新用户的步骤:

sudo adduser deploy
sudo adduser deploy sudo

0 个答案:

没有答案