Cheug's Blog

当前位置:网站首页 / Server / 正文

记录rhel6.7编译安装升级openssh8.6p1

2024-09-01 / Server / 322 次围观 / 0 次吐槽 /

zlib-1.2.11.tar.gz

openssl-1.1.1g.tar.gz

openssh-8.6p1.tar.gz


备份:

cp /etc/ssh/ /etc/ssh_bak

cp /etc/init.d/sshd  /etc/init.d/sshd.bak

cp /etc/pam.d/sshd  /etc/pam.d/sshd.bak

cp /usr/sbin/sshd /usr/sbin/sshd.bak

cp /usr/bin/ssh /usr/bin/ssh.bak

 

 

安装编译器

yum install gcc  

openssh209.png

 

卸载旧ssh

rpm -qa | grep openssh | xargs rpm -e --nodeps

openssh265.png

 

openssh267.png

 

 

 

 

安装zlib

cd zlib-1.2.11

./configure --prefix=/usr/local/zlib

openssh336.png

 

make && make install

openssh359.png

 

 

 

 

 

安装ssl

cd openssl-OpenSSL_1_1_1k

./config --prefix=/usr/local/openssl -d shared

openssh444.png

 

make && make install

openssh467.png

 

 

 

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

ldconfig -v

openssh532.png

 

 

 

 

安装openssh

cd openssh-8.6p1

./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-zlib=/usr/local/zlib --with-ssl-dir=/usr/local/openssl --with-pam=enable

openssh694.png

 

make && make install

openssh717.png

 

 

复制文件

cp /usr/local/openssh/sbin/sshd /usr/sbin/sshd

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

cp /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen

 

cd openssh-8.6p1

cp contrib/redhat/sshd.init /etc/init.d/sshd

chkconfig --add sshd

chkconfig sshd on

chkconfig --list|grep sshd

openssh1005.png

 

 

启动ssh

servvice sshd start

openssh1034.png

 

servvice sshd status

openssh1057.png

 

查看版本

ssh -V

openssh1071.png

 


Powered By Cheug's Blog

Copyright Cheug Rights Reserved.