Linux openssh8.0p1升级步骤

时间:2019-07-22 18:04:29   收藏:0   阅读:776

前期准备
开启本机telnet服务,以防openssh升级失败无法连接服务器。
注:redhat 5 6 需要注意,需求安装配置相关文件。redhat7不需要

1、安装zlib
tar -xzvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
 ./configure --prefix=/usr/local/zlib-1.2.11
 make && make install


2、安装openssl

-----------------------------------------------------------
redhat 5 执行下面行

tar -xzvf perl-5.10.0.tar.gz

cd perl-5.10.0
./configure.gnu -des -Dprefix=/usr/local/perl-5.10.0
make && make install
export PATH=/usr/local/perl-5.10.0/bin:$PATH
-----------------------------------------------------------

tar -xzvf openssl-1.1.0k.tar.gz

./config --prefix=/usr/local/openssl-1.1.0k
 
 make && make install
 
echo "/usr/local/openssl-1.1.0k/lib" >> /etc/ld.so.conf
ldconfig

3、安装openssh
备份  /etc/ssh 目录
mv /etc/ssh   /etc/ssh_bak
tar -xzvf openssh-8.0p1.tar.gz
cd openssh-8.0p1/
./configure --prefix=/usr/local/openssh-8.0p1 --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/openssl-1.1.0k --with-zlib=/usr/local/zlib-1.2.11 --with-md5-passwords
make && make install

4、配置openssh重启脚本及变量

--------------------------------------------------------
redhat 6 执行下面行
openssh-8.0p1/

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

vi /etc/init.d/sshd
SSHD=/usr/local/openssh-8.0p1/sbin/sshd     //25   SSHD=/usr/sbin/sshd
/usr/local/openssh-8.0p1/bin/ssh-keygen -A  //41   /usr/bin/ssh-keygen -A

chkconfig --add sshd
chkconfig sshd on
chkconfig --list sshd
-------------------------------------------------------


vi /etc/ssh/sshd_config   //增加下一行
PermitRootLogin yes

service sshd restart

vi /etc/profile 或者  ~/.bash_profile  设置PATH变量
export PATH=/usr/local/openssh-8.0p1/sbin:/usr/local/openssh-8.0p1/bin:$PATH
source /etc/profile

升级安全检查openssh漏洞,升级失败,申请从telnet登录服务器

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!