:~$ systemctl restart sshd
Failed to restart sshd.service: Interactive authentication required.
See system logs and 'systemctl status sshd.service' for details.
解决:
sudo systemctl enable ssh.service
错误2
错误
:~$ sudo sshd -t
/etc/ssh/sshd_config: No such file or directory
解决:
添加对应的/etc/ssh/sshd_config
错误3
错误
:~$ sudo sshd -t
Privilege separation user sshd does not exist
解决:
sudo useradd --system sshd
sudo vim /etc/passwd (选择好对应的sshd路径,sshd:x:997:997::/usr/sbin/sshd:/bin/sh)
错误4
错误
:~$ sudo sshd -t
sshd: no hostkeys available -- exiting.
解决:
:~$ sudo ssh-keygen -A
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519