View status:
systemctl status sshd.service
Start the service:
systemctl start sshd.service
Restart the service:
systemctl restart sshd.service
Boot from Kai:
systemctl enable sshd.service
Today, the project team to reflect, there is not a Centos7 server using SSH landing, so I logged on to the system through a local, we found SSH service does not start, the determination method is mainly used netstat method for viewing;
1
|
netstat
-anlpt |
grep
22
|
Speaking after this, if it is Centos7 words, if we want to use the netstat command, then you need to install net-tools can be used
1
|
yum instatll net-tools –y ----安装
netstat
工具
|
Try to manually start the sshd service fails to start, an error (22 port is not listening)
Centos7 under ssh not independent log log, so the message at
1
|
Tail –f
/var/log/message
/usr/sbin/
缺少sshd的文件
|
1
|
Cd
/usr/sbin/
下确实没有提示中的sshd文件或者目录
|
So we need to re-install it
1
|
yum reinstall openssh-server
|
The installation is complete
After the installation files have ssh file information
Files can restart sshd
1
|
systemctl start sshd ---启动sshd服务
|