Linux 下 使用源碼升級 OpenSSH

yum -y install wget tar gcc make 

wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.9p1.tar.gz
wget -c https://www.openssl.org/source/openssl-1.0.2q.tar.gz
wget -c https://sourceforge.mirrorservice.org/l/li/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
tar -zxvf openssh-7.9p1.tar.gz
tar -zxvf openssl-1.0.2q.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=/usr/local/zlib
make && make install 
cd ../openssl-1.0.2q
./config --prefix=/usr/local/ssl -d shared #默認沒有編譯出.so的文件,而openssh編譯的時候需要,所以需要手動添加 -d shared的選項
make && make install 
echo '/usr/local/ssl/lib' >> /etc/ld.so.conf
ldconfig -v 
cd ../openssh-7.9p1
./configure --prefix=/usr/local/openssh --with-zlib=/usr/local/zlib --with-ssl-dir=/usr/local/ssl
make && make install

echo 'PATH=/usr/local/openssh/bin:/usr/local/openssh/sbin:$PATH' >> /etc/profile 
source /etc/profile 
ssh -V

發佈了85 篇原創文章 · 獲贊 347 · 訪問量 84萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章