因為老版本的OpenSSH存在遠程訪問執行漏洞,因此安裝了Linux系統後需要升級OpenSSH來修復此漏洞,加強服務器安全性。
注意:升級過程中不要重啟sshd服務,否則會遠程連接不上!!
升級版本為:openssh-6.6p1
升級方法:
1、加載本地源(方法不描述了)
2、執行下列命令
yum install bash -y
yum install -y zlib zlib-devel openssl openssl-devel
tar -zxvf openssh-6.6p1.tar.gz -C /usr/local/src/
cd /usr/local/src/openssh-6.6p1/
cp /etc/init.d/sshd /etc/init.d/sshd.old
tar -cvf ssh.bak.tar /etc/ssh
yum install gcc -y
3、卸載老版本
rpm -qa|grep ssh
rpm -e openssh-server-5.3p1-81.el6.x86_64
rpm -e openssh-clients-5.3p1-81.el6.x86_64 --nodeps
rpm -qa|grep ssh
rpm -e openssh-askpass-5.3p1-81.el6.x86_64
rpm -e openssh-5.3p1-81.el6.x86_64
rpm -qa|grep ssh
4、開始升級
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-zlib --with-md5-passwords
make && make install
mv /etc/init.d/sshd.old /etc/init.d/sshd
mkdir -p /var/empty/sshd/etc
/etc/init.d/sshd restart
chkconfig --add sshd
chkconfig sshd on
chkconfig --list|grep sshd
5、查看是否升級成功
ssh -V
OpenSSH_6.6p1, OpenSSL 1.0.0-fips 29 Mar 2010
在Ubuntu Server 13.10系統中安裝配置OpenSSH http://www.linuxidc.com/Linux/2014-02/96953.htm
Ubuntu安裝遠程登錄OpenSSH服務 http://www.linuxidc.com/Linux/2014-02/97218.htm
通過OpenSSH遠程登錄時的延遲問題解決 http://www.linuxidc.com/Linux/2013-07/86879.htm
Ubuntu 12.10下OpenSSH的離線安裝方法 http://www.linuxidc.com/Linux/2013-04/82814.htm
OpenSSH升級步驟及注意事項詳解 http://www.linuxidc.com/Linux/2013-04/82123.htm
OpenSSH普通用戶無法登錄的幾種情況的解決方法 http://www.linuxidc.com/Linux/2012-05/59457.htm
通用線程: OpenSSH 密鑰管理,第 1 部分理解 RSA/DSA 認證 http://www.linuxidc.com/Linux/2011-08/39871.htm
RedHat安裝OpenSSH和配置sftp鎖定目錄 http://www.linuxidc.com/Linux/2012-12/75398.htm
OpenSSL 的詳細介紹:請點這裡
OpenSSL 的下載地址:請點這裡