Setup (and secure) an SSH server on Ubuntu

Updated . Posted . Visible to the public.

Install OpenSSH Server:

sudo apt-get install openssh-server

To check if the server is running you should get no error when you restart it:

sudo /etc/init.d/ssh restart

Now your ssh server is ready to use.

To add additional security edit your sshd_config (gksudo gedit /etc/ssh/sshd_config):

# Deny root login:
PermitRootLogin no

# To whitelist users:
AllowUsers USERNAME1 USERNAME2

# To disable interactive authentication (without SSH key)
PasswordAuthentication no

Don't forget to restart after editing the sshd_config:

sudo service ssh restart

(Tested on Ubuntu 14.04)

Martin Straub
Last edit
Keywords
daemon, demon
License
Source code in this card is licensed under the MIT License.
Posted by Martin Straub to makandra dev (2011-03-18 10:47)