Fixing “WARNING: UNPROTECTED PRIVATE KEY FILE!” on Linux
2016-10-08 20:20
1531 查看
If you are getting this error then you probably reset the permissions on your hidden .ssh directory in your user folder, and your keys aren’t going to work anymore. It’s very important that these files not be writable by just anybody with a login to the box, so openssh will give you an error if you try to use them.
The full error message:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0744 for '/home/geek/.ssh/id_rsa' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: /home/geek/.ssh/id_rsa
To fix this, you’ll need to reset the permissions back to default:
sudo chmod 600 ~/.ssh/id_rsa sudo chmod 600 ~/.ssh/id_rsa.pub
If you are getting another error:
Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/home/geek/.ssh/known_hosts).
This means that the permissions on that file are also set incorrectly, and can be adjusted with this:
sudo chmod 644 ~/.ssh/known_hosts
Finally, you may need to adjust the directory permissions as well:
sudo chmod 755 ~/.ssh
相关文章推荐
- git clone 提示"WARNING: UNPROTECTED PRIVATE KEY FILE!"的解决办法
- ssh使用秘钥文件连接提示WARNING: UNPROTECTED PRIVATE KEY FILE!(转载)
- git push提示WARNING: UNPROTECTED PRIVATE KEY FILE!
- WARNING: UNPROTECTED PRIVATE KEY FILE!的解决办法
- SSH登陆错误:“warning:unprotected private key file” 问题
- UNPROTECTED PRIVATE KEY FILE
- git clone WARNING: UNPROTECTED PRIVATE KEY FILE
- RSA private key file not found
- C# SharpSsh Private-public a pair key to Upload and Download File
- mysql 5.6 private_key.pem public_key.pem file not found
- unable to set private key file: client.pem type PEM
- Unable to use key file "xxx" (OpenSSH SSH-2 private key)
- RSA private key file not found
- 错误:Warning: File `../table/table.pro' has modification time 3.9e+08 s in the future
- WCF常见错误之密钥集不存在,The process must have access rights for the private key
- warning: no newline at end of file的原因
- MySQL无法重启问题解决Warning: World-writable config file '/etc/my.cnf' is ignored
- [Postfix] – warning: mail_queue_enter: create file maildrop Permission denied
- okToAccept: WARNING! Your cache is running out of filedescriptors
- hpux ia64(11.31) cc checkout and view private file的timestamp问题