答案1
您必须仔细检查上述文件的权限,并使它们如下所示:
$ ls -al /etc/ssh/* -rw-r--r-- 1 root root 553122 Mar 4 2019 /etc/ssh/moduli -rw-r--r-- 1 root root 1580 Mar 4 2019 /etc/ssh/ssh_config -rw------- 1 root root 668 Mar 11 2015 /etc/ssh/ssh_host_dsa_key -rw-r--r-- 1 root root 608 Mar 11 2015 /etc/ssh/ssh_host_dsa_key.pub -rw------- 1 root root 227 Mar 11 2015 /etc/ssh/ssh_host_ecdsa_key -rw-r--r-- 1 root root 180 Mar 11 2015 /etc/ssh/ssh_host_ecdsa_key.pub -rw------- 1 root root 411 Dec 6 2020 /etc/ssh/ssh_host_ed25519_key -rw-r--r-- 1 root root 100 Dec 6 2020 /etc/ssh/ssh_host_ed25519_key.pub -rw------- 1 root root 1675 Mar 11 2015 /etc/ssh/ssh_host_rsa_key -rw-r--r-- 1 root root 400 Mar 11 2015 /etc/ssh/ssh_host_rsa_key.pub -rw-r--r-- 1 root root 338 Dec 6 2020 /etc/ssh/ssh_import_id -rw-r--r-- 1 root root 3264 Mar 4 2019 /etc/ssh/sshd_config
然后通过以下方式重新启动 SSH 守护进程
sudo service sshd restart