树莓派 18.04 openssh-server和refuse和reset问题

安装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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容