linux升级openssl

cd /root

wget 下载

tar -zxvf 解压openssl最新的包,顺序:先openssl后openssh

mv /usr/bin/openssl /usr/bin/openssl.old && mv /usr/include/openssl /usr/include/openssl.old 备份老的

./config --prefix=/usr/local/openssl && make && make install   编译

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     加载lib库

openssl version   验证版本

ldconfig -v   加载lib库

cd /root 

解压ssh 后进入目录

./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-tcp-wrappers --with-ssl-dir=/usr/local/openssl --with-zlib=/usr/local/lib64 --without-hardening && make && make install    编译

\cp -a contrib/redhat/sshd.init /etc/init.d/sshd && \cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam && chmod +x /etc/init.d/sshd      添加启动脚本

chkconfig --add sshd && chkconfig sshd on    加入开机启动

ssh -V 验证版本  

处理过程总结:

# openssl

mv /usr/bin/openssl /usr/bin/openssl.old && mv /usr/include/openssl /usr/include/openssl.old

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

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

openssl version

# openssh

./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-tcp-wrappers --with-ssl-dir=/usr/local/openssl --with-zlib=/usr/local/lib64 --without-hardening && make && make install

\cp -a contrib/redhat/sshd.init /etc/init.d/sshd && \cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam && chmod +x /etc/init.d/sshd

chkconfig --add sshd && chkconfig sshd on

/etc/init.d/sshd restart

你可能感兴趣的:(linux升级openssl)