- 安装了CentOS-7-x86_64-Minimal-1611
- 运行命令yum install -y openssh-server,第一遍没有-y,后来reinstall的
- /etc/init.d/目录下没有sshd这个文件,
-
相关的什么check也不行,怎么做成系统启动?
炒蛋啊! 有6.9这个版本靠谱吗?
相关的什么check也不行,怎么做成系统启动?
炒蛋啊!
有6.9这个版本靠谱吗?
在Centos7中,Systemd进程取代了init进程,systemctl代替service和chkconfig两个命令。
启动sshd服务:
systemctl start sshd.service
重启sshd服务:
systemctl restart sshd.service
设置sshd服务开机自启:
systemctl enable sshd.service
7版本和6版本在服务的管理上有很大的区别,你提到打得“/etc/init.d/”是6版本的形式,现在7统一用命令systemctl对服务进行统一管理。具体细节请参考systemctl相关命令的文档说明.
(1)设置开机自启动服务:systemctl enabled sshd.service
或 systemctl enabled sshd
(2)设置临时启动服务:systemctl start sshd.service
或 systemctl start sshd
(3)设置临时关闭服务:systemctl stop sshd.service
或 systemctl stop sshd
(4)设置重启服务:systemctl restart sshd.service
或 systemctl restart sshd
7 回答5.3k 阅读
4 回答4k 阅读
2 回答5.9k 阅读✓ 已解决
2 回答2.5k 阅读✓ 已解决
1 回答2.3k 阅读✓ 已解决
2 回答793 阅读✓ 已解决
2 回答3.2k 阅读
service sshd start 不行就试试 systemctl enable sshd.service