In order to use SSH (secure shell), it is necessary to install the SSH server. In Debian based distributions, such as Debian and Ubuntu, use the following commands to install the SSH server. If you have enabled root login, execute these commands as root. Otherwise, use sudo in front of each command.
You can also use the following command to install the SSH client:
By default, openssh-server configures the SSH server in a fairly secure way. However, you should double check the configuration first. As root, edit the file /etc/ssh/sshd_config. Particularly, look for a line that starts with PermitRootLogin. If this line is missing altogether, or it is commented out (with a # symbol at the left), the default is to allow remote root login.
You should consider turning this option off. Do this by adding the following line to /etc/ssh/sshd_config:
Note that this option only helps to improve security, but it does not stop an intruder from hacking into a system and gain root access. An intruder can potentially hack into a regular user account which has sudo ability, and gain access as root eventually.