For a multitude of reasons, it’s a good idea to set up SSH access on any Ubuntu desktop/server you are responsible for. The process itself is pretty straightforward.
1. Open a terminal and enter the following:
sudo apt-get install openssh-server
This will download the openssh server and may take a while depending on connection speeds etc
2. I would highly recommend tightening the security on our newly installed SSH box. SSH’s config file is located in /etc/ssh/sshd_config so before we muck around with it, lets take a copy:
sudo cp /etc/ssh/sshd_config ~
A copy of sshd_config now resides in your home directory
3. To edit the sshd_config file:
sudo nano /etc/ssh/sshd_config
Note: I’m using ‘nano’ as my text editor here. Please feel free to use your favourite editor instead
4. Go to the very end of the config file and add these two lines:
PermitRootLogin no
AllowUsers USERS
USERS = the usernames of the people who will be allowed access to the box via SSH. These people, and these people alone will be able to connect via SSH
5. This is optional but you can also change the default port of TCP/IP port 22 to an alternative. You would need to make any users aware of this port change. Changing the port reduces the chances of your box/SSH connection being discovers and malicious scanners etc
6. Because we’ve edited the SSH config file we need to restart the SSH daemon
sudo /etc/init.d/ssh restart
You now have a working SSH connection. Congratulations.