一、列出解决过程中所有报错信息
- ssh connection refused port 22
- Stopped OpenBSD Secure Shell server. Failed to start OpenBSD Secure Shell server.
- OpenSSL version mismatch. Built against 1010104f, you have 101000cf
- Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
- This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
- Missing privilege separation directory: /run/sshd
二、ssh连接拒绝的原因
由于CM3升级了openssl,导致ssh服务启动出错,SSH connection refused。所有ssh连接都拒绝。查看sshd服务运行状态,提示Failed to start OpenBSD Secure Shell server。查看sshd 报错原因为:OpenSSL version mismatch. Built against 1010104f, you have 101000cf。因此,主要是openssl版本过低的问题,通过升级即可解决。
三、解决过程
1、定位问题
service sshd restart
systemctl status ssh.service
sshd -T
2、更新系统和源
apt-get update
apt update
3、重新安装openssl ssh
apt-get remove openssl
apt-get remove ssh
apt-get install openssl
apt-get install ssh
4、查看sshd 错误
sshd -T
新建一个目录即可:
mkdir /run/sshd
5、重启sshd服务即可登录ssh
service sshd restart