Configuring SSH on Debian 7

This is a mini guide to configure SSH on a Debian 7 server, I’m currently using Debian 7 x86 on a VPS so this guide can help you setup SSH on your vps, just adapt it to your distro of choice.

If you don’t have Open SSH installed, then you can do it by using apt-get install openssh-server,  after you’re done you can check the configuration files located under /etc/ssh/.

There are two important files there, one for the ssh server and another one for the client:

/etc/ssh/ssh_config –> This one is for the client

/etc/ssh/sshd_config –> This is the one we care about, all the setting here apply to our SSH server

This is an example of an sshd_config file

The following lines are the ones I’ve changed to add some extra security.

Just be aware that changing your configuration file with the lines above will require you to have SSH keys for  authentication, if you don’t have one then you won’t be able to sign back into your server after restarting the service.

Once you have saved your configuration file you can restart the SSH service

When I have more time I will be posting about setting up fail2ban to protect your ssh server from brute force attacks, but for now you should have a functioning SSH server.


Got any comments? contactme (a t_) dr0u. c o m