1、上传zlib-1.2.12,openssl-1.1.t,openssh-9.3p1压缩文件到服务器
zlib下载地址:zlib Home Sitehttp://www.zlib.net/
openssl下载地址:/source/index.htmlhttps://www.openssl.org/source/
openssh下载地址:OpenSSH: for OpenBSDOpenSSH for OpenBSDhttps://www.openssh.com/openbsd.html
2、解压上传压缩包
[root@localhost ~]# tar -zxvf 压缩包
3、创建编译目录
[root@localhost ~]# mkdir -p /usr/local/zlib/
[root@localhost ~]# mkdir -p /usr/local/openssl/
[root@localhost ~]# mkdir -p /usr/local/openssh/
4、卸载openssh
[root@localhost ~]# yum remove openssh
5、卸载openssl
[root@localhost ~]# rpm -qa | grep openssl
openssl-1.1.1f-1.ctl2.x86_64
openssl-pkcs11-0.4.10-1.ctl2.x86_64
openssl-libs-1.1.1f-1.ctl2.x86_64
# 注意不要删除openssl-libs-1.1.1f-1.ctl2.x86_64
[root@localhost ~]# rpm -e openssl-pkcs11-0.4.10-1.ctl2.x86_64
[root@localhost ~]# rpm -e perl-IO-Socket-SSL
[root@localhost ~]# rpm -e rng-tools
6、安装编译需要用到的依赖包
[root@localhost ~]# yum -y install gcc gcc-c++ make perl pam-devel
7、编译安装zlib
# 进入zlib解压目录
# 预编译
[root@localhost ~/zlib-1.2.12]# ./configure --prefix=/usr/local/zlib/
# 编译
[root@localhost ~/zlib-1.2.12]# make && make install
# 查看版本
[root@localhost ~/zlib-1.2.12]# ll /usr/local/zlib/lib
8、编译安装openssl文章来源:https://www.toymoban.com/news/detail-451792.html
# 进入openssl解压目录
# 预编译
[root@localhost ~/openssl-1.1.1t]# ./config --prefix=/usr/local/openssl/ --openssldir=/usr/local/openssl/ shared
# 编译
[root@localhost ~/openssl-1.1.1t]# make && make install
# 创建软连接文件
[root@localhost ~/openssl-1.1.1t]# ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
# 不摒弃老版本的情况下,下面几步无需执行
#echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
#ldconfig
#ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1
#ln -s /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
# 检查版本
[root@localhost ~/openssl-1.1.1t]# openssl version
OpenSSL 1.1.1t 7 Feb 2023 (Library: OpenSSL 1.1.1f 31 Mar 2020)
9、编译安装openssh文章来源地址https://www.toymoban.com/news/detail-451792.html
# 进入openssh解压目录
# 预编译
[root@localhost ~/openssh-9.3p1]# ./configure --prefix=/usr/local/openssh/ --sysconfdir=/etc/ssh/ --with-openssl-includes=/usr/local/openssl/include/ --with-ssl-dir=/usr/local/openssl/ --with-zlib=/usr/local/zlib/ --with-md5-passwords --without-openssl-header-check
# 编译
[root@localhost ~/openssh-9.3p1]# make -j 4 && make install
# 创建软连接
[root@localhost ~/openssh-9.3p1]# ln -s /usr/local/openssh/sbin/sshd /sbin/sshd
[root@localhost ~/openssh-9.3p1]# ln -s /usr/local/openssh/bin/ssh /usr/bin/ssh
[root@localhost ~/openssh-9.3p1]# ln -s /usr/local/openssh/bin/scp /usr/bin/scp
[root@localhost ~/openssh-9.3p1]# ln -s /usr/local/openssh/bin/sftp /usr/bin/sftp
[root@localhost ~/openssh-9.3p1]# ln -s /usr/local/openssh/bin/ssh-add /usr/bin/ssh-add
[root@localhost ~/openssh-9.3p1]# ln -s /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen
[root@localhost ~/openssh-9.3p1]# ln -s /usr/local/openssh/bin/ssh-keyscan /usr/bin/ssh-keyscan
# 配置启动脚本,并设置开机自启动
[root@localhost ~/openssh-9.3p1]# cp -rf /root/openssh-9.3p1/contrib/redhat/sshd.init /etc/init.d/sshd
[root@localhost ~/openssh-9.3p1]# cp -rf /root/openssh-9.3p1/contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
[root@localhost ~/openssh-9.3p1]# chkconfig --add sshd
[root@localhost ~/openssh-9.3p1]# chkconfig sshd on
# 修改配置文件
[root@localhost ~/openssh-9.3p1]# vi /etc/ssh/sshd_config
# 修改前
PermitRootLogin without-password
# 修改后
PermitRootLogin yes
# 查看版本
[root@localhost ~/openssh-9.3p1]# ssh -V
OpenSSH_9.3p1, OpenSSL 1.1.1f 31 Mar 2020
到了这里,关于Ctyun系统 升级OpenSSH 9.3的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!