Linux openssh升级8.0

#下载openssh连接

--(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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值