一次ssh登录不成功的解决经历

一、列出解决过程中所有报错信息

  • 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值