Sivo 悉见

Failed to restart ssh.service: Unit not found.

匿名 · 更新于 2022/11/23

1、在修改了sshd_config配置文件以后

vim /etc/ssh/sshd_config
  • 1

2、重启ssh

service ssh restart
  • 1

3、出现以下报错

Redirecting to /bin/systemctl restart ssh.service
Failed to restart ssh.service: Unit not found.
  • 1
  • 2

4、原因:以上命令都是centos6里面的命令,在centos7需要用

systemctl restart sshd
  • 1

5、问题完美解决,nice