Please enter the code
Alibaba Cloud's ubuntu server has an sshd daemon from the beginning and can be connected using putty
Modify the heartbeat packet time and modify /etc/ssh/sshd_config
When I wanted to restart the service, I found that there was no sshd under /etc/init.d
, and a search found that sshd existed under /usr/sbin
Unable to execute sshd restart, sshd start , sshd stop and other commands, it is prompted that there is no such command.
Unable to restart sshd service
Finally, by directly killing the sshd process, and then directly executing /usr/sbin/sshd
, you can start the sshd process again and load the modified configuration.
If you have already installed
openssh-server
的话(没有的话,要安装),因为Ubuntu已经使用Upstart
来进行管理/etc/init.d
里面的任务. 所以/etc/init.d/sshd start
已经无效了.注意: 应该用sudo service ssh start
(注意: 是ssh,不是sshd)启动sshd
服务,之后可以通过进程查看sshd
The process is already running.If you look at the /etc/init.d/ssh file, you will know that this file is the script to start, stop, and restart sshd, which is also called a service.
So you can start/stop/restart sshd via sudo /etc/init.d/ssh start/stop/restart or sudo service ssh start/stop/restart
What is executed in this script is /usr/sbin/sshd
Directly killall/kill the process before starting