溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

怎樣升級openssh7.9

發(fā)布時間:2021-11-06 15:19:19 來源:億速云 閱讀:95 作者:柒染 欄目:建站服務(wù)器

這期內(nèi)容當(dāng)中小編將會給大家?guī)碛嘘P(guān)怎樣升級openssh7.9,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

umask 022
yum install -y pam-devel libselinux-devel krb5-devel zlib-devel gcc make
LANG=C
cd /root
tar xf openssl-1.0.2r.tar.gz
tar xf openssh-7.9p1.tar.gz
cd /root/openssl-1.0.2r
./config --prefix=/usr/local/openssl-1.0.2r --openssldir=/usr/local/openssl-1.0.2r zlib shared && make -j 4 && make install

echo '/usr/local/openssl-1.0.2r/lib' > /etc/ld.so.conf.d/openssl.conf
ldconfig
chmod 600 /etc/ssh/ssh_host_*

cd /root/openssh-7.9p1
./configure --prefix=/usr/local/openssh7.9p1 --sysconfdir=/etc/ssh --with-selinux --with-pam\
 --with-ssl-dir=/usr/local/openssl-1.0.2r\
 --with-md5-passwords --with-zlib --mandir=/usr/share/man\
 --with-kerberos5 --with-xauth --with-sandbox\
 && make -j 4 && make install 

alias cp='cp'

cp /root/openssh-7.9p1/contrib/redhat/sshd.init /etc/init.d/sshd

chmod +x /etc/init.d/sshd

cp -f /usr/local/openssh7.9p1/bin/* /usr/bin/
cp -f /usr/local/openssh7.9p1/sbin/* /usr/sbin/
cp -f /usr/local/openssh7.9p1/libexec/* /usr/libexec/openssh/

restorecon /usr/bin/{scp,sftp,ssh,ssh-add,ssh-agent,ssh-keygen,ssh-keyscan}
restorecon /usr/sbin/sshd
restorecon /usr/libexec/openssh/{sftp-server,ssh-keysign,ssh-pkcs11-helper}

以上代碼可以放在一個文件中自動執(zhí)行升級

升級完成后要執(zhí)行,讓root可以登錄

echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

如果已經(jīng)設(shè)置了

chkconfig sshd on

但不能在重啟后自動啟動sshd服務(wù),但可以手動開啟服務(wù)成功,并有可能報錯如下

[root@rhel6 init.d]# service sshd start
Starting sshd:/usr/sbin/sshd: error while loading shared libraries: libcrypto.so.1.0.0: failed to map segment from shared object: Permission denied
[FAILED]

需要檢查

getenforce是否是Enforcing,打開/etc/selinux的配置文件config,將SELINUX改為disabled。啟動服務(wù)不再報錯,重啟系統(tǒng)

sshd服務(wù)可以自動啟動了

上述就是小編為大家分享的怎樣升級openssh7.9了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI