Ubuntu starts or restarts SSH service

To open SSH service, you first need to install the library to open SSH service:

sudo apt-get install openssh-server

Check the current SSH opening status:

ps -e |grep ssh

If SSHD is present, sSH-Server is already started. If there is only agent, it has not been started;
open SSH service:

/etc/init.d/ssh start

To start or want to restart SSH, modify the configuration and restart the SSH service:

vi /etc/ssh/sshd_config

Then you can see the configuration file and modify it according to the requirements.
restart SSH:

sudo /etc/init.d/ssh restart

Read More: