ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Linux openssh升级8.0

Linux openssh升级8.0

原创 Linux操作系统 作者:dmcatding 时间:2019-05-10 15:16:18 0 删除 编辑

#下载openssh连接

https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/


--(1)检查openssh

# rpm -qa|grep openssh

openssh-clients-6.6.1p1-31.el7.x86_64

openssh-server-6.6.1p1-31.el7.x86_64

openssh-6.6.1p1-31.el7.x86_64


--(2)避免openssh失败无法登陆安装telnet

yum install -y telnet-server xinetd --安装

echo -e 'pts/0\pts/1\npts/2\pts/3'  >>/etc/securetty

systemctl enable xinetd.service

systemctl enable telnet.socket

systemctl start telnet.socket

systemctl start xinetd


--(3)卸载旧的openssh

# rpm -e `rpm -qa | grep openssh` --nodeps

如果之前就是源码安装的,找到之前的安装包,在里面执行

make uninstall


--(4)安装必要的软件:

yum -y install gcc pam pam-devel zlib zlib-devel openssl-devel


--(5)解压编译

tar -zxvf openssh-8.0p1.tar.gz

cd openssh-8.0p1

./configure    --prefix=/usr  --sysconfdir=/etc/ssh  --with-md5-passwords --with-zlib --with-ssl-dir=/usr/local/ssl \  

--with-privsep-path=/var/lib/sshd

make

make install


如果遇到如下报错:chmod 600 /etc/ssh/ssh_host_*

install -v -m755 contrib/ssh-copy-id /usr/bin

install -v -m644 contrib/ssh-copy-id.1 /usr/share/man/man1

install -v -m755 -d /usr/share/doc/openssh-8.0p1

install -v -m644 INSTALL LICENCE OVERVIEW README* /usr/share/doc/openssh-8.0p1



echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config

echo 'UsePAM yes' >> /etc/ssh/sshd_config


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

chmod +x /etc/init.d/sshd

chkconfig --add sshd

chkconfig sshd on

chkconfig --list sshd


--(6)重启验证

systemctl restart sshd



--(7)验证完毕后,关闭telnet服务

vi /etc/securetty

删除增加的4行:

pts/0

pts/1

pts/2

pts/3


#停止telnet服务

systemctl stop telnet.socket

systemctl disable telnet.socket


systemctl stop xinetd.service

systemctl disable xinetd.service


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30327022/viewspace-2643917/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Tomcat 8安装部署
下一篇: Centos 7安装iscsi
请登录后发表评论 登录
全部评论

注册时间:2015-07-04

  • 博文量
    48
  • 访问量
    49142