您的位置:首页 > 娱乐 > 明星 > CentOS 6.4环境 升级到OpenSSH9.2p1

CentOS 6.4环境 升级到OpenSSH9.2p1

2024/10/5 14:56:00 来源:https://blog.csdn.net/lakeside1/article/details/140146688  浏览:    关键词:CentOS 6.4环境 升级到OpenSSH9.2p1

系统环境:

[root@localhost]# cat /etc/centos-release
CentOS release 6.4 (Final)
[root@localhost]# sshd -V
unknown option -- V
OpenSSH_6.7p1, OpenSSL 1.0.0-fips 29 Mar 2010

服务器以前升级过openssl/openssh

安装openssl和openssh

[root@localhost ~]# pwd
/root
[root@localhost ~]# tar zxvf openssl-1.0.2u.tar.gz
[root@localhost ~]# cd openssl-1.0.2u
[root@localhost openssl-1.0.2u]# make
[root@localhost openssl-1.0.2u]# make test
[root@localhost openssl-1.0.2u]# make install
[root@localhost openssl-1.0.2u]# echo "/usr/local/openssl-1.0.2u/lib" >> /etc/ld.so.conf[root@localhost openssl-1.0.2u]# /sbin/ldconfig -v[root@localhost openssl-1.0.2u# /usr/local/openssl*/bin/openssl version -a
OpenSSL 1.0.2u  20 Dec 2019
built on: reproducible build, date unspecified
platform: linux-x86_64
options:  bn(64,64) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx) 
compiler: gcc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
OPENSSLDIR: "/usr/local/openssl-1.0.2u/ssl"[root@localhost ~]# tar zxvf  openssh-9.2p1.tar.gz
[root@localhost ~]# cd openssh*
[root@localhost openssh-9.2p1]#./configure --prefix=/usr/local/openssh-9.2p1 --with-ssl-dir=/usr/local/openssl-1.0.2u/  --with-pam --with-zlib
[root@localhost openssh-9.2p1]#make && make install
[root@localhost openssh-9.2p1]# /usr/local/openssh-9.2p1/sbin/sshd -V
OpenSSH_9.2, OpenSSL 1.0.2u  20 Dec 2019

注意: 安装openssl时,make test会出错,把时间改为20230101,就可以通过。然后再改回来

#date MMDDhhmm[[CC]YY][.ss]例如,将系统时间设置为2023年1月1日,1点1分,可以使用:
#date 010101012023#再改回20240703 11:05
#date 070311052024

修改配置

停止sshd服务,删除sshd启动配置
#service sshd stop
#chkconfig --del sshd进入ssh安装解压目录
#cp ./contrib/redhat/sshd.init /etc/init.d/sshd9.2
(/etc/init.d 实际链接 /etc/rc.d/init.d)修改启动文件
#vi /etc/rc.d/init.d/sshd9.2
...
# Some functions to make the below more readable
#SSHD=/usr/sbin/sshd
#PID_FILE=/var/run/sshd.pid
SSHD=/usr/local/openssh-9.2p1/sbin/sshd
PID_File=/var/run/sshd9_2.pid
...添加启动
#chkconfig --add sshd9.2
#service sshd9.2 start 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com