3 things to do after installing an Ssh Server

Ssh Server is a service that runs on Linux operating  that allow remote access to the machine. At the time that im writing this post Windows is trying to implement an native Ssh Server on Windows.

We mainly use Ssh to remote access Linux server for administration. Here is 5 essentials things to do just after installing your Ssh Server :

Installing Ssh Server :

#apt-get install openssh-server


#yum install openssh-server

The configuration files of ssh is found in /etc/ssh/

Be careful when modifying the ssh_config and sshd_config,  sshd meaning that you are modifying the Deamon (The Server side) , the ssh mean that you are modifying the client side.

1st. thing to do :

Create an ssh key:

#ssh-keygen -t rsa
#chmod 600 ~/.ssh/id_rsa*

Push your key on the server :

#ssh-copy-id [email protected]

Disable the root Login with Password.

#sudo vim /etc/ssh/sshd_config

Change the parameter PermitRootLogin to without-password :

#PermitRootLogin without-password

Save the file and restart the service /etc/init.d/ssh restart

2nd. thing to do :

Change the port number of ssh

This will reduce brute force attack performed by bots scanning all the network in the world.

#vim /etc/ssh/sshd_config

Change the port number :

# What ports, IPs and protocols we listen for
Port 3200
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::

Save the file and restart ssh

#/etc/init.d/ssh restart

3rd. thing to do :

Install fail2ban

#apt-get install fail2ban

This will temporarily ban ips that failed to connect to the server for a laps of time.

Now that you have secure your ssh connection you can connect to with much more insurance.

Article by Ash

“Your eyes can deceive you. Don’t trust them.” – Obi-Wan Kenobi