Linux升級ssh、ssl
yum install -y gcc openssl-devel pam-devel rpm-build 【下載相關依賴包】
wget http://10.10.8.8/openssl-1.0.2p.tar.gz 【下載ssl,可到相應資源網站去下載最新】
tar -zxvf openssl-1.0.2p.tar.gz && cd openssl-1.0.2p 【解壓】
./config --prefix=/usr/local/openssl --shared
make && make install 【編譯及安裝】
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
echo "/usr/local/openssl/lib" >>/etc/ld.so.conf
ldconfig -v
openssl version -a
cd /root/Desktop
wget http://10.10.8.8/openssh-7.9p1.tar.gz 【下載ssh,到相應資源網站下載】
rpm -e `rpm -qa | grep openssh` --nodeps
tar -zxvf openssh-7.9p1.tar.gz && cd openssh-7.9p1
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/openssl --with-zlib --with-md5-passwords --with-pam --with-tcp-wrappers 【可能會出現:configure: error: PAM headers not found 錯誤,需要安裝pam-devel的rpm包
make && make install
sed -i ‘s/#PermitRootLogin prohibit-password/PermitRootLogin\ yes/g‘ /etc/ssh/sshd_config 【允許root遠程登陸】
sed -i ‘s/#PermitEmptyPasswords\(.*\)/PermitEmptyPasswords\ no/g‘ /etc/ssh/sshd_config 【禁止空密碼】
cp contrib/redhat/sshd.init /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
service sshd start
service sshd restart
chkconfig --list sshd
ssh -V
rm -rf /root/Desktop/openssl-1.0.2p.tar.gz
rm -rf /root/Desktop/openssl-1.0.2p
rm -rf /root/Desktop/openssh-7.9p1.tar.gz
rm -rf /root/Desktop/openssh-7.9p1
rm -rf /root/Desktop/w.txt
Linux升級ssh、ssl