ssh 使用密钥无法登入Linux系统,sshlinux


今天测试密钥登入linux系统时 出现如下问题:
 
root@compute01:~# ssh alicxxx@xxx.com -p 80 -i alickicxxxxxxx.key

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for 'alickxxxxxxx.key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: alickicxxxxxxxxxxx.key
Permission denied (publickey).

解决方法:
 
chmod  600  alickicxxxxxxxxxxx.key

然后再试试就可以了。要先限制其他用户无法使用这个密钥。只能是root用户才能使用这个密钥。

相关内容