1、上傳zlib-1.2.12,openssl-1.1.t,openssh-9.3p1壓縮文件到服務(wù)器
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、創(chuàng)建編譯目錄
[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
# 進(jìn)入zlib解壓目錄
# 預(yù)編譯
[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文章來源:http://www.zghlxwxcb.cn/news/detail-451792.html
# 進(jìn)入openssl解壓目錄
# 預(yù)編譯
[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
# 創(chuàng)建軟連接文件
[root@localhost ~/openssl-1.1.1t]# ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
# 不摒棄老版本的情況下,下面幾步無需執(zhí)行
#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文章來源地址http://www.zghlxwxcb.cn/news/detail-451792.html
# 進(jìn)入openssh解壓目錄
# 預(yù)編譯
[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
# 創(chuàng)建軟連接
[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
# 配置啟動腳本,并設(shè)置開機(jī)自啟動
[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
到了這里,關(guān)于Ctyun系統(tǒng) 升級OpenSSH 9.3的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!