首页 > 智能设备 > 正文

centos7升级ssh

智能设备 时间:2024-10-26 13:01:56

Centos7升级ssh

1. 备份原有文件。mkdir ssh.bak cp /etc/ssh/* /etc/ssh.bak

2. 安装并启动Telnet。yum install telnet telnet-server xinetd -y systemctl start telnet.socket systemctl start xinetd //设置开机自启动 systemctl enable telnet.socket systemctl enable xinetd //添加Telnet配置文件 vi /etc/xinetd.d/telnet //添加下列语句 # default: on # description: The telnet server serves telnet sessions; it uses \ # unencrypted username/password pairs for authentication. service telnet { flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd log_on_failure + = USERID disable = no //默认为yes时,不允许root登录 } vi /etc/securetty //添加下列语句,允许远程设备使用root账号登录 pts/0 pts/1

3. 卸载旧版本ssh(Telnet登录)。systemctl stop sshd //查询已安装的openssh包 rpm -qa | grep openssh //结果 openssh-server-7.4p1-16.el7.x86_64 openssh-clients-7.4p1-16.el7.x86_64 openssh-7.4p1-16.el7.x86_64 //卸载 rpm -e openssh* --nodeps //删除配置文件 rm -rf /etc/ssh/*

4. 安装ssh。上传ssh安装包并解压到 /usr/local/openssh 目录

郑重声明:图文由自媒体作者发布,我们尊重原作版权,但因数量庞大无法逐一核实,图片与文字所有方如有疑问可与我们联系,核实后我们将予以删除。