There are several implementations of ssh, with the most popular being OpenSSH, which is developed by the OpenBSD project. Ubuntu comes with a preinstalled version of OpenSSH client, however, if you need to use the machine as a server you have to install OpenSSH server by yourself. Installation can be done either manually, or by using the apt tool (or synaptic package manager). The installation is pretty straight forward. Installation can be done with the following command on a terminal having root privileges:

 

This way is much faster than searching and installing through synaptic.

Of course the installation part does not stop there. The most important part of the installation is as in the most cases the configuration part. The configuration files of both openssh-client and openssh-server reside in /etc/ssh/.

directory listing for /etc/ssh/

 

The files ssh_config and sshd_config are the configuration files of openssh-client and openssh-server respectively. The rest of the files are keys that are used in the communication. Changes for the functionality of the ssh server (or the sshd deamon) will be done in sshd_config.

At this point, we will take a closer look at sshd_config, the ssh server configuration file. We can open in with an editor, in the specific case with nano with the command

 

a gui editor (such as gedit) can be used as well. OpenSSH, in the later versions, comes with the protocol 1 disabled by default due to the security issues that arise from the possible man-in-the-middle and downgrade attacks. In order to change the supported protocols, we have to add 1 in the ‘protocol’ line which is by default

Protocol 2

So after changing we will have

Protocol 2,1

The order of the numbers 1 and 2 does not play any specific role.

After adding protocol 1, we have to create a key. We can do it using the ssh-keygen module of OpenSSH. We type the command

root@debrah:/etc/ssh# ssh-keygen -t rsa1 -f new_key

where -t is the algorith to be used and -f indicates the name of the new file. If we are not in the /etc/ssh/ directory, we either need to navigate to it or add it before the name of the file ( -f /etc/ssh/new_key )

The new key file need to be added as a HostKey in sshd_conf. So after the lines which start with HostKey, we add another line with the absolute path to the file of the key that we have already created.

After the changes to the sshd_config file we have to restart the ssh server for them to take place. In order to restart the server type in the command line one of the following commands:

 

or

 

Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>