Ubuntu,  Unix

Configure sshd for Ubuntu Server 10

Installing things in Linux is just silly easy these days. Getting them to work just like you want them is a little more complicated, but not that bad really… By default, Ubuntu Server 10 doesn’t come with ssh enabled. To install it, just run apt-get with elevated privileges and tell it to install ssh (aka – openssh-server):

apt-get install openssh-server

Once that’s complete every user on your system will be able to authenticate via ssh. Go ahead and test out authentication. Provided that it works, it’s time to restrict who can authenticate via ssh. Do so by editing the /etc/ssh/sshd_config file and adding a line that starts with AllowUsers and then lists the users you would like to allow:

AllowUsers      cedge krypted

I also don’t like running ssh on the default port. In the same file (/etc/ssh/sshd_config) let’s go ahead and change that. Find the line for “Port” and change it to something else (like 2020):

Port 2020

Note: If you’ve enabled Kerberos on your box, check out the KerberosAuthentication options…

Finally, reload the config now that you’ve made some changes:

/etc/init.d/ssh reload