ssh用私钥登录远程服务器时提示私钥不安全问题解决

来源:互联网 发布:手机数据损坏如何恢复 编辑:程序博客网 时间:2024/06/05 13:41

ssh用私钥ding_test.pem登陆服务器11.10.37.54

root@test-ubuntu:~# ssh -i ding_test.pem ubuntu@11.10.37.54The authenticity of host '11.10.37.54 (11.10.37.54)' can't be established.ECDSA key fingerprint is SHA256:FFPaPnDwHqIU2Kp1m46lgTRxaCPf4H5xKyRH8eJNMVc.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '11.10.37.54' (ECDSA) to the list of known hosts.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Permissions 0644 for 'ding_test.pem' are too open.It is required that your private key files are NOT accessible by others.This private key will be ignored.Load key "ding_test.pem": bad permissionsPermission denied (publickey).

出现如上错误。

解决方法为 chmod 600

root@test-ubuntu:~# chmod 600 ding_test.pem root@test-ubuntu:~# ssh -i ding_test.pem ubuntu@11.10.37.54Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-43-generic x86_64) * Documentation:  https://help.ubuntu.com * Management:     https://landscape.canonical.com * Support:        https://ubuntu.com/advantage  Get cloud support with Ubuntu Advantage Cloud Guest:    http://www.ubuntu.com/business/services/cloud0 packages can be updated.0 updates are security updates.The programs included with the Ubuntu system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted byapplicable law.To run a command as administrator (user "root"), use "sudo <command>".See "man sudo_root" for details.ubuntu@test-ubuntu2:~$ 

ssh远程登陆成功!

原创粉丝点击