# 如果您是第一次升级,备份/etc/init.d/sshd时会不存在,不影响后续操作 [root@localhost ~]# mv /etc/init.d/sshd /etc/init.d/sshd.bak mv: 无法获取'/etc/init.d/sshd' 的文件状态(stat): No such file or directory
# 卸载现有OpenSSH [root@localhost ~]# rpm -e --nodeps $(rpm -qa |grep openssh) 警告:文件 /etc/ssh/sshd_config:移除失败:No such file or directory 警告:文件 /etc/ssh/ssh_config.d/05-redhat.conf:移除失败:No such file or directory 警告:文件 /etc/ssh/ssh_config.d:移除失败:No such file or directory 警告:文件 /etc/ssh/ssh_config:移除失败:No such file or directory 警告:文件 /etc/ssh/moduli:移除失败:No such file or directory 警告:文件 /etc/ssh:移除失败:No such file or directory
# 启用sshd,生成服务配置文件 [root@localhost openssh-8.6p1]# systemctl enable sshd sshd.service is not a native service, redirecting to systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install enable sshd