SSH Key: “Permissions 0644 for 'id_rsa.pub' are too open.” on mac -
i generate ssh key pair on mac , add public key ubuntu server(in fact, virtual machine on mac),but when try login ubuntu server,it says:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ warning: unprotected private key file! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ permissions 0644 '/users/tudouya/.ssh/vm/vm_id_rsa.pub' open. required private key files not accessible others. private key ignored. bad permissions: ignore key: /users/tudouya/.ssh/vm/vm_id_rsa.pub permission denied (publickey,password).
i have tried many ways solve this, change key file mode, change folder mode,as answer on stackoverflow,but doesn't work.
key file permission:
vm dir: drwxr-xr-x 4 tudouya staff 136 4 29 10:37 vm key file: -rw------- 1 tudouya staff 1679 4 29 10:30 vm_id_rsa -rw-r--r-- 1 tudouya staff 391 4 29 10:30 vm_id_rsa.pub
please give me idea... =========================================
write host infomation ssh_config:
host ubuntuvm hostname 10.211.55.17 preferredauthentications publickey identityfile /users/tudouya/.ssh/vm/vm_id_rsa.pub
i run command "ssh -v ubuntuvm",it displays:
ssh -v ubuntuvm openssh_6.2p2, osslshim 0.9.8r 8 dec 2011 debug1: reading configuration data /etc/ssh_config debug1: /etc/ssh_config line 20: applying options * debug1: /etc/ssh_config line 103: applying options * debug1: /etc/ssh_config line 175: applying options ubuntuvm debug1: connecting 10.211.55.17 [10.211.55.17] port 22. debug1: connection established. debug1: identity file /users/tudouya/.ssh/vm/vm_id_rsa.pub type 1 debug1: identity file /users/tudouya/.ssh/vm/vm_id_rsa.pub-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-8 debug1: match: openssh_6.6.1p1 ubuntu-8 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 55:6d:4f:0f:23:51:ac:8e:70:01:ec:0e:62:9e:1c:10 debug1: host '10.211.55.17' known , matches rsa host key. debug1: found key in /users/tudouya/.ssh/known_hosts:54 debug1: ssh_rsa_verify: signature correct 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,password debug1: next authentication method: publickey debug1: offering rsa public key: /users/tudouya/.ssh/vm/vm_id_rsa.pub debug1: server accepts key: pkalg ssh-rsa blen 279 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ warning: unprotected private key file! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ permissions 0644 '/users/tudouya/.ssh/vm/vm_id_rsa.pub' open. required private key files not accessible others. private key ignored. bad permissions: ignore key: /users/tudouya/.ssh/vm/vm_id_rsa.pub debug1: no more authentication methods try. permission denied (publickey,password).
debug1: identity file /users/tudouya/.ssh/vm/vm_id_rsa.pub type 1
it appears you're trying use wrong wrong key file. file ".pub" extension public key file. corresponding file without ".pub" extension private key file. when run ssh client connect remote server, have provide private key file ssh client.
judging debug trace, have line in file /etc/ssh_config
looks this:
identityfile .../.ssh/vm/vm_id_rsa.pub
you need remove ".pub" extension filename:
identityfile .../.ssh/vm/vm_id_rsa
Comments
Post a Comment