Linux 升級最新版本openSSH 7.8p

*注意:如果一次安裝失敗,下次安裝前解壓縮的目錄一定要刪除

依賴包以及主包

升級openssh前需要先升級依賴包,教程如下

1、zlib-1.2.11.tar.gz

# tar xzvf zlib-1.2.11.tar.gz

#cd zlib-1.2.11

# ./configure --prefix=/usr/local/zlib
# make
# make install

這樣,就把 zlib 編譯安裝在
/usr/local/zlib 中了

2、pam-devel-1.1.1-13.el6.x86_64.rpm

# rpm -ivh pam-devel-1.1.1-13.el6.x86_64.rpm

3、openssl-fips-2.0.16.tar.gz

# tar -xzvf openssl-fips-2.0.16.tar.gz

# cd openssl-fips-2.0.16

# ./config

# make

# make install

4、openssl-1.0.2p.tar.gz

#tar -zxvf   openssl-1.0.2p.tar.gz

#cd  /openssl-1.0.2p

#./config shared zlib --prefix=/usr/local/openssl && make && make install

# ./config -t

# make depend

# cd /usr/local

# ln -s openssl ssl

# vi /etc/ld.so.conf    

文件的最後面,添加如下內容:

/usr/local/openssl/lib

#ldconfig

在etc/的profile的最後一行,添加:

      export OPENSSL=/usr/local/openssl/bin

      export PATH=$OPENSSL:$PATH:$HOME/bin

移除老版本的openssl,創建新的軟連接;這個地方注意路徑

mv /usr/bin/openssl /usr/bin/openssl.old

mv /usr/include/openssl /usr/include/openssl.old

ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl

ln -s /usr/local/openssl/include/openssl /usr/include/openssl

ln -sf /usr/local/openssl/lib/libcrypto.so.1.0.0 /lib/libcrypto.so.6

echo "/usr/local/openssl/lib" >>/etc/ld.so.conf 

ldconfig -v
# openssl version

4、openssh-7.8p1.tar.gz

 #tar -xzvf openssh-7.8p1.tar.gz

# cd openssh-7.8p1

#./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-pam --with-ssl-dir=/usr/local/openssl --with-md5-passwords --mandir=/usr/share/man --with-zlib=/usr/local/zlib --without-hardening

#make

#make install

# cp /你的openssh的解壓目錄/contrib/redhat/sshd.init /etc/init.d/sshd

# chmod +x /etc/init.d/sshd

# chkconfig --add sshd

#vim /etc/ssh/sshd_config #修改默認端口號

# /etc/init.d/sshd restart

#cp /usr/local/openssh/bin/ssh /usr/bin/

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章