Thursday 15 March 2012

amazon web services - AWS SSH connect from OSX keep asking for password for SSH Key -



amazon web services - AWS SSH connect from OSX keep asking for password for SSH Key -

as per ben's answer, created key pair, downloaded private key ~/.ssh , changed permissions 600 , tried ssh instance ... got unauthorized erro :

$ ssh -v -i ~/.ssh/aws-erwin16.pem jack@ec2-nn-nn-nnn-nnn.us-west-2.compute.amazonaws.com openssh_6.2p2, osslshim 0.9.8r 8 dec 2011 debug1: reading configuration info /users/jack/.ssh/config debug1: reading configuration info /etc/ssh_config debug1: /etc/ssh_config line 20: applying options * debug1: connecting ec2-nn-nn-nnn-nnn.us-west-2.compute.amazonaws.com [54.69.113.179] port 22. debug1: connection established. debug1: identity file /users/jack/.ssh/aws-erwin16.pem type -1 debug1: identity file /users/jack/.ssh/aws-erwin16.pem-cert type -1 debug1: enabling compatibility mode protocol 2.0 debug1: local version string ssh-2.0-openssh_6.2 debug1: remote protocol version 2.0, remote software version openssh_6.6.1p1 ubuntu-2ubuntu2 debug1: match: openssh_6.6.1p1 ubuntu-2ubuntu2 pat openssh* debug1: ssh2_msg_kexinit sent debug1: ssh2_msg_kexinit received debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com 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: server host key: rsa 85:e4:69:56:21:4d:32:1c:e9:5c:83:a5:cc:28:03:39 debug1: host 'ec2-nn-nn-nnn-nnn.us-west-2.compute.amazonaws.com' known , matches rsa host key. debug1: found key in /users/jack/.ssh/known_hosts:22 debug1: ssh_rsa_verify: signature right debug1: ssh2_msg_newkeys sent debug1: expecting ssh2_msg_newkeys debug1: ssh2_msg_newkeys received debug1: roaming not allowed server debug1: ssh2_msg_service_request sent debug1: ssh2_msg_service_accept received debug1: authentications can continue: publickey debug1: next authentication method: publickey debug1: offering rsa public key: /users/jack/.ssh/id_rsa debug1: authentications can continue: publickey debug1: trying private key: /users/jack/.ssh/aws-erwin16.pem debug1: read pem private key done: type rsa debug1: authentications can continue: publickey debug1: no more authentication methods try. permission denied (publickey).

if alter user name ubuntu , , runs fine... connecte d..;

you have confused x.509 certificates amazon ec2 keypairs. ec2 keypairs used log in ec2 instances.

in ec2 console, find keypairs section on left, generate keypair, , save private key locally disk. openssh searches ~/.ssh directory default. run chmod 600 ~/.ssh/<filename> set right permissions. can utilize key access instance via ssh.

amazon-web-services osx-mavericks ssh-keys

No comments:

Post a Comment