Only SSH Tutorial You need to Read – What is SSH & Everything about it

Ever wondered how to remotely control a server without compromising on the security side? If you did, then you must have come across this term, SSH.

In this tutorial, we will learn exactly what SSH is, how does it work and why it’s needed. Let’s get into the details now.

What is SSH Protocol?

Secure Socket Shell or Secure Shell is what SSH stands for. It’s a network protocol to communicate with a remote server over a secured layer.

SSH Protocol is of great help for server administration as it allows the user to remotely connect with a server and do the needful tasks. The upside of the SSH protocol over traditional one (Telnet) is that the communication and data transfer happens using a secured channel.

what-is-ssh

Good enough for the introduction, huh? Let’s dive into much more details to get to the gist of this topic.

Brief History of SSH

The protocol was first designed by a researcher named Tatu Ylönen at Helsinki University of Technology in 1995. He released the first version named SSH-1 and also started a cybersecurity vendor in Waltham.

In 2006, the second (also the current) version, SSH-2 was standardized and adopted as a Standards Track specification by the IETF. This made the protocol really popular around the globe which is used till date.

How is SSH secure?

SSH uses cryptographic encryption techniques which first setups a secured and private channel between the user-end and server-end and then it begins the data transfer in encrypted form.

Not a single piece of data is left un-encrypted thus, increasing the layer of security to the maximum level. To manage a remote server, SSH Protocol comes really handy and it is becoming a standard among the industry these days.

The modern age SSH protocol uses various encryption methods including AES (Advanced Encryption Standard), Blowfish, etc.

What is SSH used for?

With the aforementioned details, I think it is pretty clear to you as of now that what is SSH used for. It is used for communicating and managing a server remotely without compromising on the security.

How does SSH Protocol work?

SSH Protocol is divided into two parts. The first one among the two is authentication which works on Asymmetric Encryption principle instead of the Symmetric one. I’ll get into the details of authentication process now.

In the explanation below, User is referred to the person who wants to access the server and the Server will be referred to the second end.

As we’re talking about the Asymmetric method in this case, there is a Public Key and a Private Key involved. A standard SSH communication happens as mentioned below.

Step 1 – User wants to communicate with the Server remotely. To make it happen, the user sends his Public Key to the Server over an open network. By open network, I mean not-secured or public network.

Step 2 – The Server encrypts a dummy data packet using the Public key received from the User. The encrypted data is sent back to the User.

Step 3 – On receiving the data, User decrypts the data packet using his Private key. Thing to note here that this data packet can only be decrypted using User’s Private key, nothing else.

Step 4 – User now sends the data received back to the Server. This confirms the identity of the User to the Server and the authentication process is complete.

Step 5 – Now the User and Server can communicate with each other on this secured layer.

This is how the authentication process of SSH Protocol works which I hope is now clear to you.

Note – This whole setup remains secure till the Private key is not disclosed to the public. Only if the Private key is available to everyone then the secured layer can be breached. Otherwise, it’s going to stay rock solid.

As the first part of the protocol is over, it’s time to jump to the Second one.

If the authentication is successful, then SSH starts using Symmetric algorithm to keep using the communication between User and Server, transferring the required data.

In Symmetric algorithm only a single key is involved which is used to encrypt and decrypt the data at both ends. The single secret key used in the process is mutually agreed by both User and Server.

This part of the process remains secure till the key exchange algorithm is not available to the public. Both User and Server encrypts and decrypts the data and shares it on an open channel.

How do I access SSH?

SSH Protocol can be accessed on Windows machine using a third-party program named PuTTY while on Mac machine, it can be accessed using the Terminal itself.

1. SSH for Windows

To access SSH on Windows, you need to use a third-party program and PuTTY is the recommended one. It can be downloaded for free.

Using PuTTY makes thing easy as it uses the graphical interface but you still need to be aware of the technicalities of the software. It basically works as a client from the user side to communicate with the server end.

SSH for Windows 10 users

Windows 10 users are in luck as Microsoft has officially included SSH integration. To ensure you get this feature, kindly ensure that Windows 10 OS is up to date or at least updated to April 2018 upgrades released.

As it happens, you no longer need to rely on third-party applications like PuTTY. Now, about a step by step tutorial on how to install SSH on Windows 10 and use it further?

Let’s begin with the steps.

Step 1 – As this application is included as an optional feature, you need to begin with its installation procedure first. To do that, go into Settings and click on Apps.

Step 2 – Now under the Apps and features section, click on “Manage optional features” link. Click on “Add a feature” now.

install-ssh-windows10-pc-laptop

Step 3 – You need to scroll through the available list and click on “OpenSSH Client (Beta)” and hit Install button to proceed.

Step 4 – Reboot the system and as it starts, Hit the Start button and run the program named “Windows PowerShell.”

Step 5 – Type in “ssh” command, hit Enter and you’ll see that it’s working on your Windows 10 system.

Easy, right?

2. SSH for Mac

Mac users are in luck as the Terminal program can be used to access SSH. Simply start the Terminal and run following code to start with the authentication process.

ssh {user}@{host}

In the above line, the user represents the user account (e.g., root) while the host represents the server (IP address or Domain) you wish to connect.

Step 1 – Open the Terminal app which is the command prompt application for the Mac platform. It will be used to access and establish SSH connection on Mac.

connect-ssh-mac-terminal

Step 2 – Now type in following line and hit enter. As mentioned above, you need to type in the domain or IP address. Replace the ‘tabbloidx.com’ with your domain or IP address.

ssh root@134.209.34.99m

Step 3 – Connection process begins inside the Terminal which will now ask for the password to authenticate the process. If it’s the first time, you’ll get message to confirm this connection. Type ‘yes’ and hit Enter.

The authenticity of host 'example.com (IPaddress)' can't be established.

RSA key fingerprint is 1a:2b:3c:99:5d:b5:c6:25:5a:d3:78:8e:d2:f5:7a:01.

Are you sure you want to continue connecting (yes/no)?

Step 4 – This is where you need to type in password for the server and hit Enter. On successful authentication, the SSH connection will be established with the server and you’ll be greeted with following message.

Last login: Sun Dec  'IPaddress' from 'IPaddress'

############################################################

(mt) shortcuts

############################################################

To see your Plesk password, type: p

To rebuild your Apache/Web Server configuration, type: web

To rebuild your Qmail/Mail Server configuration, type: mchk

To see your Qmail/Mail Server queue, type: q

To completely restart your Qmail/Mail server, type: r

To connect to your MySQL server as admin, type: my

To get rid of these messages/aliases, edit your /root/.bash_profile

[root@current ~]#

Simple, isn’t it?

What is SSH Tunneling?

The technique used to start a secure tunnel between the local host and remote host is termed as SSH tunneling. It is also known as SSH port forwarding technique.

The tunnelling is used by the IT administrators for advance applications mostly but it’s also used to create malicious attempts and can be stopped using putting a firewall.

Conclusion

I hope you get to the basics of SSH protocol in this tutorial and now understand what it is, how it works and how to start with it. If you’ve read everything till now, you might be overwhelmed with the details of SSH protocol. But there is still more to it which can be explored once you put this to use.

Leave a Reply