centos7.5升級(jí)openssh9.3p1,openssl1.1.1t
注意:升級(jí)后由于加密算法的區(qū)別,低版本的SSH工具可能無(wú)法連接,建議改用Xshell7或SecureCRT9.0以上版本。
一、安裝前查看系統(tǒng)及版本
二、安裝步驟
1.下載tar包
wget https://www.openssl.org/source/openssl-1.1.1t.tar.gz --no-check-certificate
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.3p1.tar.gz
wget http://www.zlib.net/zlib-1.2.13.tar.gz
解壓到指定路徑:
tar zxvf openssl-1.1.1t.tar.gz -C /usr/local/src/
tar zxvf openssh-9.3p1.tar.gz -C /usr/local/src/
tar zxvf zlib-1.2.13.tar.gz -C /usr/local/src
2.安裝zlib
cd /usr/local/src/
cd zlib-1.2.13/
./configure --prefix=/usr/local/zlib && make -j 4 && make install
3.安裝openssl
cd /usr/local/src/openssl-1.1.1t/
./config --prefix=/usr/local/ssl -d shared
make -j 4 && make install
echo '/usr/local/ssl/lib' >> /etc/ld.so.conf
ldconfig -v
4.安裝openssh
mv /etc/ssh /etc/ssh.bak
cd /usr/local/src/openssh-9.3p1/
./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/ssl --with-zlib=/usr/local/zlib
make -j 4 && make install
5.修改配置文件
(1)sshd_config文件修改
echo "X11Forwarding yes" >> /etc/ssh/sshd_config
echo "X11UseLocalhost no" >> /etc/ssh/sshd_config
echo "XAuthLocation /usr/bin/xauth" >> /etc/ssh/sshd_config
echo "UseDNS no" >> /etc/ssh/sshd_config
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config
需要添加X11Forwarding yes開啟X11轉(zhuǎn)發(fā),調(diào)用圖形界面,如oracle安裝等操作需要圖形界面
***必須添加X11UseLocalhost no 和 XAuthLocation /usr/bin/xauth 這兩項(xiàng),否則X11轉(zhuǎn)發(fā)不好使
驗(yàn)證X11轉(zhuǎn)發(fā)是否好使,xhost + 出現(xiàn)下面的是可以正常使用的
出現(xiàn)下面的內(nèi)容是不能正常使用的
xhost: unable to open display “”
(2) 備份 /etc/ssh 原有文件,并將新的配置復(fù)制到指定目錄
mv /usr/sbin/sshd /usr/sbin/sshd.bak
cp -rf /usr/local/openssh/sbin/sshd /usr/sbin/sshd
mv /usr/bin/ssh /usr/bin/ssh.bak
cp -rf /usr/local/openssh/bin/ssh /usr/bin/ssh
mv /usr/bin/ssh-keygen /usr/bin/ssh-keygen.bak
cp -rf /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen
安裝完成,查看版本ssh -V
6.啟動(dòng)sshd文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-579365.html
systemctl restart sshd
開機(jī)自啟文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-579365.html
systemctl enable sshd
到了這里,關(guān)于centos7.5升級(jí)openssh9.3p1,openssl1.1.1t的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!