Restart the sshd daemon

Now it's necessary to restart or rehup the sshd process to have it re-read the new configuration. On some systems you can use the following scipt to restart the ssh daemon:

/etc/init.d/sshd restart

On DigitalOcean servers this script is not installed, and you need to kill and restart the ssh daemon manually. This can be done by finding out the process number (pid) for the ssh daemon using:

ps auxw | grep ssh

Pick out the PID from the output which looks like:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 681 0.0 0.1 49948 2332 ? Ss 2012 3:23 /usr/sbin/sshd -D

And kill the ssh daemon process:

kill -HUP 681

Now your server's root login is protected and you can test this by trying to SSH directly as root to this server from a system that doesn't have its keys shared and you will be automatically kicked out without being prompted for a root password.