openSSH升级常见报错汇总

openSSH升级(常见报错)

 

目录

1:编译安装gcc

2:升级openSSL

3: openssl-devel安装

4:安装pam-devel

5:sshd未识别的服务

6: Linux每次重启xshell拒绝连接(已经开通root)

7: centos7升级openssh,启动ssh服务失败

8: checking OpenSSL library version... configure: error: OpenSSL >= 1.0.1 required (have "10000003 (OpenSSL 1.0.0-fips 29 Mar 2010)")

9: key exchange failed

1: bug截图

2:原因分析

3:解决方法

下面的解决方式,请详见我的博客,该文章只是主要针对报错给我的解决方案

https://blog.csdn.net/qq_26963433/article/details/108496965

1:编译安装gcc

 

这是因为你的centos没有安装gcc,你是需要安装gcc的

进入安装目录  

cd  /tools/openSSH/gcc

rpm  -ivh  *.rpm --nodeps --force

 

2:升级openSSL

 

发现还有错误,这是因为升级openSSH的同时需要先升级openSSL

 

3: openssl-devel安装

 

   还有可能会包"OpenSSL headers missing - please install first or check config.log ***"的错误,这是缺少openssl-devel所致,只需安装openssl-devel即可,执行命令:yum install openssl-devel

 

4:安装pam-devel

 

提示你需要安装pam-devel

 

5:sshd未识别的服务

service sshd restart 启动后报错:为什么会报这个错哩,这是因为之前的Linux自带的openSSH卸载掉了

rpm -qa|grep openssh

 

依次卸载里面的安装包

rpm -e --nodeps openssh-server-5.3p1-94.el6.x86_64

yum remove openssh -y

 

 

https://www.cnblogs.com/nmap/p/10779658.html

如果不拷贝,将会报sshd:未识别的服务这个错误,如果目录之前就存在,直接覆盖就好了

进入安装目录后 cd /training/openssh-8.0p1/

cp -a contrib/redhat/sshd.init /etc/init.d/sshd

cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam

chmod +x /etc/init.d/sshd

chkconfig --add sshd

 

然后再执行

service sshd restart

 

 

6: Linux每次重启xshell拒绝连接(已经开通root)

我升级完openssh后也遇到了这个问题,每次虚拟机重启都要使用Telnet登录重启一次sshd服务才能连接。

 

原因分析

卸载之前

 

卸载之后

yum remove openssh -y

 

得出结论,不能卸载,因为重装后,并没有相关的openssh的服务端和客户端的安装包了,在centos7之前的版本是没有对应openssh8.0更新版本对应的服务端和客户端的安装包的

没有下面两个安装包

http://www.rpmfind.net/linux/rpm2html/search.php?query=openssh-server(x86-64)

openssh-server-8.0p1

openssh-clients-8.0p1

 

7: centos7升级openssh,启动ssh服务失败

编译安装时候

 

Starting sshd (via systemctl): Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details.

[失败]

 

查看启动状态

 

systemctl status sshd.service

 

如果不授权,会报如下错误哦,会导致启动失败

  chmod 600 /etc/ssh/ssh_host_rsa_key

  chmod 600 /etc/ssh/ssh_host_ecdsa_key

 

 

8: 编译指令错误

checking OpenSSL library version... configure: error: OpenSSL >= 1.0.1 required (have "10000003 (OpenSSL 1.0.0-fips 29 Mar 2010)")

 

问题原因:

centos6.5使用的openSSH编译安装指令不对

错误指令

./configure --prefix=/usr/ --sysconfdir=/etc/ssh --with-zlib --with-md5-passwords --with-pam && make install

 

正确指令

./configure --prefix=/usr/ --sysconfdir=/etc/ssh  --with-openssl-includes=/usr/local/ssl/include \

 --with-ssl-dir=/usr/local/ssl   --with-zlib   --with-md5-passwords   --with-pam  && make && make install

 

 

 

9: key exchange failed

1: bug截图

Key exchange failed. No compatible key exchange method. The server supports these methods: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256

 

 

2:原因分析

升级高版本的openSSH后,新版本不支持老版本的密钥交换算法

3:解决方法

修改 /etc/ssh/sshd_config配置文件,在最后面一行加上

KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1

 

 

 

 

  • 5
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值