安装openss-server后,连接出错
refuse错误
$ ssh 192.168.10.134
ssh: connect to host 192.168.10.134 port 22: Connection refused
安装ssh service
sudo apt-get install openssh-server
sudo apt-get install openssh-client
reset 错误
$ ssh 92.168.10.134
Connection closed by 192.168.10.134 port 22
查看认证错误
$ cat /var/log/auth.log
...
Jun 19 10:18:19 wchyan-desktop sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 19 10:18:22 wchyan-desktop sudo: pam_unix(sudo:session): session closed for user root
Jun 19 10:18:33 wchyan-desktop sshd[2876]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Jun 19 10:18:33 wchyan-desktop sshd[2876]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Jun 19 10:18:39 wchyan-desktop sshd[2876]: Accepted password for wchyan from 192.168.10.72 port 62118 ssh2
Jun 19 10:18:39 wchyan-desktop sshd[2876]: pam_unix(sshd:session): session opened for user wchyan by (uid=0)
Jun 19 10:18:39 wchyan-desktop systemd-logind[707]: New session 3 of user wchyan.
生产证书
$sudo ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key
$sudo ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
其他refuse错误
尝试一下关闭防火墙
sudo ufw disable
sudo iptables -F
网友评论