cat /var/log/message # 查看日志报告一下错误
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: @ WARNING: UNPROTECTED PRIVATE KEY FILE! @
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: Permissions 0715 for '/etc/ssh/ssh_host_rsa_key' are too open.
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: It is required that your private key files are NOT accessible by others.
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: This private key will be ignored.
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: key_load_private: bad permissions
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: @ WARNING: UNPROTECTED PRIVATE KEY FILE! @
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: Permissions 0715 for '/etc/ssh/ssh_host_ecdsa_key' are too open.
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: It is required that your private key files are NOT accessible by others.
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: This private key will be ignored.
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: key_load_private: bad permissions
May 12 15:14:33 host-10-69-15-70 sshd[4906]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
# 总结 只要出现这种错误
Permissions 0715 for '/etc/ssh/ssh_host_ecdsa_key' are too open.
没别的 就是 密码类linux文件给的权限太高了 肯定是个菜鸟干的
# 查看 报错服务器ssh下面文件
ll /etc/ssh
total 604
-rwxr-xr-x. 1 root root 581843 Apr 11 2018 moduli
-rwxr-xr-x. 1 root root 2276 Apr 11 2018 ssh_config
-rwxr-xr-x 1 root root 3907 May 12 14:56 sshd_config
-rw-------. 1 root ssh_keys 227 Dec 28 14:11 ssh_host_ecdsa_key
-rwxr-xr-x. 1 root root 162 Dec 28 14:11 ssh_host_ecdsa_key.pub
-rw-r----- 1 root ssh_keys 387 May 12 15:02 ssh_host_ed25519_key
-rw-r--r--. 1 root root 82 May 12 15:02 ssh_host_ed25519_key.pub
-rwxr-xr-x. 1 root ssh_keys 1675 Dec 28 14:11 ssh_host_rsa_key
-rwxr-xr-x. 1 root root 382 Dec 28 14:11 ssh_host_rsa_key.pub
# 正常 服务器 ssh下面文件的权限
ll /etc/ssh
total 604
-rw-r--r--. 1 root root 581843 Apr 11 2018 moduli
-rw-r--r--. 1 root root 2276 Apr 11 2018 ssh_config
-rw-------. 1 root root 3907 Apr 11 2018 sshd_config
-rw-r-----. 1 root ssh_keys 227 Dec 28 14:11 ssh_host_ecdsa_key
-rw-r--r--. 1 root root 162 Dec 28 14:11 ssh_host_ecdsa_key.pub
-rw-r-----. 1 root ssh_keys 387 Dec 28 14:11 ssh_host_ed25519_key
-rw-r--r--. 1 root root 82 Dec 28 14:11 ssh_host_ed25519_key.pub
-rw-r-----. 1 root ssh_keys 1675 Dec 28 14:11 ssh_host_rsa_key
-rw-r--r--. 1 root root 382 Dec 28 14:11 ssh_host_rsa_key.pub
# 解决办法 重新授权 为 600即可 或者先直接删除报错文件