一、打开telnet
1、检查有没有安装telnet
rpm -aq telnet*
没有就安装
yum -y install -y telnet-server-0.17-64.el7.x86_64 telnet-0.17-64.el7.x86_64 xinetd*
2、配置/etc/xinetd.d/telnet文件
cat /etc/xinetd.d/telnet
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
3、启动telnet
systemctlrestart xinetd
4、检查telnet有没有通
telnet IP 23
二、升级openssh
1、安装依赖包
rpm -Uvh openssh-9.0p1-1.el7.x86_64.rpm openssh-askpass-9.0p1-1.el7.x86_64.rpm openssh-askpass-gnome-9.0p1-1.el7.x86_64.rpm openssh-clients-9.0p1-1.el7.x86_64.rpm openssh-debuginfo-9.0p1-1.el7.x86_64.rpm openssh-server-9.0p1-1.el7.x86_64.rpm
如下提示 请安装依赖包
libXt.so.6()(64bit)libatk-1.0.so.0()(64bit) libcairo.so.2()(64bit) libgdk-x11-2.0.so.0()(64bit) libgdk_pixbuf-2.0.so.0()(64bit) libgtk-x11-2.0.so.0()(64bit) libpango-1.0.so.0()(64bit) libpangocairo-1.0.so.0()(64bit) libpangoft2-1.0.so.0()(64bit)
Yum install -y libXt* libatk* libcairo* libgdk* libpango*
2、升级openssh
rpm -Uvh openssh-9.0p1-1.el7.x86_64.rpm openssh-askpass-9.0p1-1.el7.x86_64.rpm openssh-askpass-gnome-9.0p1-1.el7.x86_64.rpm openssh-clients-9.0p1-1.el7.x86_64.rpm openssh-debuginfo-9.0p1-1.el7.x86_64.rpm openssh-server-9.0p1-1.el7.x86_64.rpm
3、更改配置文件
vim /etc/ssh/sshd_config
HostKeyAlgorithms=+ssh-rsa,ssh-dss
KexAlgorithms=+diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
4、检查有没有报错
sshd -t
如有上图包错 ,是因为文件权限太大,将报错提示的文件权限设置为600
Chmod 600
5、启动sshd服务
systemctl restart sshd.service
打开另一个crt串口连接 如密码验证不过去
systemctl status sshd.service如出现如下如报错
修改配置文件vi /etc/pam.d/sshd
auth required pam_sepermit.so
auth include password-auth
account required pam_nologin.so
account include password-auth
password include password-auth
session required pam_selinux.so close
session required pam_loginuid.so
session required pam_selinux.so open env_params
session optional pam_keyinit.so force revoke
session include password-auth
再次启动
systemctl restart sshd.service