Ubuntu Zero to Hero Ubuntu Zero to Hero | Page 15

Other Provisions As a further enhancement to security on your server, you can block SSH access for your root user. This user has maximum privileges, so, you don't want to make it accessible to the world. Before you restrict this, you'll need to make sure that you have another administrative user (referred to as su (super user)) that you can use in the place of root. To add a user to the sudo group just type 'sudo adduser sudo' to your terminal. Now, if you SFTP to your server and navigate to /etc/ssh, you will find a file called sshd_config. If you open this file, you will see a line that says 'PermitRootLogin'. Remove 'yes' and replace this with 'no'. This stops anyone from connecting to the server through SSH using the root username and password. To view these changes, you'll need to restart the SSH service on your server. You can do this by typing 'sudo service ssh restart' into the terminal. You should now find that your root login no longer works (both over SFTP and SSH). www.netshock.co.uk