记录rhel6.7编译安装升级openssh8.6p1
2024-09-01 / Server / 576 次围观 / 0 次吐槽 /备份:
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

卸载旧ssh
rpm -qa | grep openssh | xargs rpm -e --nodeps


安装zlib
cd zlib-1.2.11
./configure --prefix=/usr/local/zlib

make && make install

安装ssl
cd openssl-OpenSSL_1_1_1k
./config --prefix=/usr/local/openssl -d shared

make && make install

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

安装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

make && make install

复制文件
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

启动ssh
servvice sshd start

servvice sshd status

查看版本
ssh -V

Powered By Cheug's Blog
Copyright Cheug Rights Reserved.