赞
踩
#漏洞处理#
$ ssh -V
点击 telnet-0.17-66.el7.x86_64.rpm进行下载
点击xinetd-2.3.15-14.el7.x86_64.rpm进行下载
点击telnet-server-0.17-66.el7.x86_64.rpm进行下载
$ mkdir telnet
$ cd telnet
$ ls
telnet-0.17-66.el7.x86_64.rpm xinetd-2.3.15-14.el7.x86_64.rpm telnet-server-0.17-66.el7.x86_64.rpm
$ cd telnet
$ rpm -Uvh *.rpm --nodeps --force
$ systemctl start telnet.socket
$ systemctl start xinetd
$ echo 'pts/0' >>/etc/securetty
$ echo 'pts/1' >>/etc/securetty
$ systemctl restart telnet.socket
$ systemctl enable xinetd
$ systemctl enable telnet.socket
$ rpm -qa | grep telnet
telnet-0.17-66.el7.x86_64
telnet-server-0.17-66.el7.x86_64
$ rpm -qa | grep xinetd
xinetd-2.3.15-14.el7.x86_64
如果碰到Login incorrect
字样
修改文件 /etc/pam.d/remote ,注释auth required pam_securetty.so
这一行
$ openssl version
下载地址:https://link.zhihu.com/?target=https%3A//www.openssl.org/source/openssl-1.1.1i.tar.gz
yum -y install gcc pam-devel zlib-devel openssl-devel
tar -xzvf openssl-1.1.1i.tar.gz
cd openssl-1.1.1i
./config
make && make install
ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
$ openssl version
1.1 先创建一个普通用户 (升级成功后可能出现无法使用root直连,需要先进入普通用户再切换至root)
$ useradd test
1.2 修改root密码(root密码需要大于8位,过于简单升级后可能无法连接)
$ yum install pam-devel -y
$ mkdir openssh
$ cd openssh/
$ cp /etc/ssh/sshd_config /home/sshd_config.backup
$ cp /etc/pam.d/sshd /home/sshd.backup
$ rpm -e --nodeps `rpm -qa | grep openssh`
$ cd openssh/
$ tar -zxvf openssh-9.5p1.tar.gz
$ cd openssh-9.5p1
CCFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib64" ./configure
$ make && make install
$ chmod 600 /etc/ssh/ssh_host_rsa_key
$ chmod 600 /etc/ssh/ssh_host_ecdsa_key
$ chmod 600 /etc/ssh/ssh_host_ed25519_key
$ cd /root/openssh/openssh-9.5p1
$ cp -a contrib/redhat/sshd.init /etc/init.d/sshd
$ chmod u+x /etc/init.d/sshd
$ mv /home/sshd.backup /etc/pam.d/sshd
$ mv /home/sshd_config.backup /etc/ssh/sshd_config
/etc/ssh/sshd_config
配置文件$ vim /etc/ssh/sshd_config
$ chkconfig --add sshd
$ chkconfig sshd on
$ systemctl restart sshd
如果是安装再local下
重启失败说明: 修改 vim /etc/rc.d/init.d/sshd 文件 SSHD修改为SSHD=/usr/local/sbin/sshd
ln -s /usr/local/bin/ssh /usr/bin/ssh
$ ssh -V
$ systemctl stop telnet.socket
$ systemctl stop xinetd
$ rpm -e --nodeps `rpm -qa | grep telnet`
$ rpm -e --nodeps `rpm -qa | grep xinetd`
$ rpm -qa | grep telnet
$ rpm -qa | grep xinetd
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。