SSH means Secure SHell, an effective network protocol for the purpose of remote administration. As its name implies, it transfers data to or from the remote system securely, i.e. in an encrypted form. Therefore, the one who may be sniffing to the activity going on in your system may not be able to get the information, what is being transferred.
SSH is one of the protocols to remotely access the server, which also have “ssh” installed in it. This protocol uses SCP (Secure Copy) command to share the data between various hosts connected in a network, that ensures confidentiality.
The OpenSSH is the most common implementation of SSH, which allows you to do the same which telnet, ftp or rlogin can do. However, the advantage of using OpenSSH is it’s encryption technology implemented using the algorithms such as DES, 3DES, Blowfish, etc. One thing you must be kept in mind that OpenSSH is not a protocol, it’s just a set of program that uses SSH protocol to improvise the ssh protocol features.
Check how to install and configure SSH (Secure Shell) in Ubuntu. The version of Ubuntu installed on my machine is Ubuntu 14.04, but don’t worry, the commands will work irrespective of the version installed on your system.
Steps to Install and Configure SSH (Secure SHell) in Ubuntu
Step 1: Are you ready to install openssh-server. OK! Open the “Terminal” window and type “sudo apt-get install openssh-server”, and press enter.
Step 2: Just type the password for sudo, if you’re a root user then you are not required to do so. After this, you”ll see a line, alerting about the ‘additional disk space will be requires required.’ Type “Y” to move ahead.
Step 3: When you are done with the installation process, check whether the service is working or not. By default, SSH operates on the port 22, so you can easily determine that whether the host is listening to port 22 or not.
Step 4: For that,type: “sudo netstat -tulpn” and press enter. In the output, you would see that the program name “tcp…/sshd” is active.
Step 5: Once you’ve installed SSH, you have an access to everything that ssh provides for the security purpose as per the standards. Meanwhile, it’s not a restriction that you can’t configure it according to your needs.
Suppose, you are interested to change the default port of ssh, for the sake of more security benefits, for this you have to play with the server file, i.e.“sshd_config”.
Open up the file using nano editor, write “sudo nano /etc/ssh/sshd_config”.
Step 6: Here, you”ll notice “Port 22”, change it to your desired port. I have changed it to “5678”.
Step 7: Press “Ctrl +X” to exit, then you will be asked to save the changes, say yes to it and the changes will be seen in the same file which is opened.
Step 8: You are back to the terminal window. For an instance, want to restart ssh: write “sudo service ssh restart” and press enter.
Step 9: The “ssh” will now restart. From the output, you’ll find out that it’s done.
Step 10: Again, type the command “sudo netstat -tulpn” and press enter. Netstat is used to display incoming as well as outgoing network connections, network statistics and the network interfaces connected to the Ubuntu machine.
Netstat can be used with different options as per your requirement. Here, netstat is followed by tulpn, that will show up the information of open ports with its port number.
Step 11: In the output, you have to check that the new port which you have assigned to “openssh” is active or not. In this case, the port 5678, as highlighted in the figure, is active.