openssh升級到openssh-7.5p1踩坑


環境:ubuntu

需要的安裝包:

http://zlib.net/   zlib 1.2.11最新版

http://www.linux-pam.org/library/   pam 1.3.0

https://github.com/openssl/openssl   openssl 1.0.2k

https://github.com/openssh/openssh-portable  openssh-7.5p1

(可以用wget 或者 git clone 獲取,並選擇特定的版本)

(注:源碼安裝坑還是很多的,如果可以用包安裝的話盡量用包安裝,折騰了幾天才弄好,而且由於不熟悉linux,很多錯誤都要慢慢研究)

 

注意過程中如果不成功會導致無法使用ssh連接,所以成功之前最好打開多個連接窗口,成功后才關閉,過程中不要關閉電腦

需要切換到su賬戶

1.升級zlib

tar zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make && make install

 

2.升級pam

tar zxvf  Linux-PAM-1.3.0.tar.gz

cd Linux-PAM-1.3.0

./configure

make && make install

 

3、編譯安裝openssl

 

刪除原來的版本,否則會在第四步出現openssl header 和openssl lib 版本不一致的錯誤

多次輸入命令: ldd /usr/bin/openssl 找到 libssl 和 libcrypto 所在路徑,並刪除它們,直到沒有

(參考:http://askubuntu.com/questions/830466/libcrypto-so-1-0-0-no-version-information-available-required-by-ssh)

tar zxvf openssl-1.0.2k.tar.gz   (或者 git checkout OpenSSL_1_0_2k)
cd openssl-1.0.2k

./config --prefix=/usr/ --openssldir=/usr/ shared

make clean

make && make install

用 openssl version 命令可查看openssl的版本,成功后輸入以下命令

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

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

echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
ldconfig -v

 

4、編譯安裝openssh
tar zxvf openssh-7.5p1.tar.gz
cd openssh-7.5p1
./configure --with-zlib --with-ssl-dir --with-pam --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc/ssh

make clean

make && make install

完成后查看ssh版本。ssh -V查看

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM