- Senior Writer
- Author
SSH, Secure Shell, or Secure Socket Shell plays a fundamental role in the domain of secure remote access. Alongside RDP (Remote Desktop Protocol), SSH holds its place as one of the top protocols by providing seamless and secure interactions.
Essentially, SSH offers a robust and reliable protocol for establishing connections with remote servers and devices through a terminal. It stands as a protected gateway, enabling system and network administrators to achieve highly secure remote access to their equipment.
In this SSH tutorial, we will delve into the Secure Shell protocol, explaining the SSH meaning and how does it work. We’ll also guide you through the process of connecting to a remote Linux server using an SSH client, PuTTY.
Securely connecting to two remote servers using the SSH protocol involves two components: SSH client and SSH server. The client is the software running on your local device, while the server component runs on the remote machine.
Once a secure SSH connection is established, a shell session initiates, allowing you to interact with the server by entering SSH commands via the terminal from your local client machine, forward ports, and create tunnels.
Let’s discuss the working of SSH in detail.
You can initiate a connection from the SSH client to the remote server in the following steps:
By default, SSH protocol version 2 is used for enhanced security and modern communication. Next, let’s discuss what kind of encryption techniques are used while using SSH protocol.
SSH uses two different types of encryption techniques:
Symmetric encryption is a method of encrypting data where a single secret key is employed for both encrypting and decrypting the messages. This means that the message being broadcast may be decrypted by anybody who has access to the key.
In this type of SSH encryption, the client and the server generate a secret key through a mutually agreed-upon process, and this key is never disclosed to any other entities.
Sometimes referred to as shared key or shared secret encryption, symmetric encryption typically involves a single key or, occasionally, a pair of keys. In the case of a key pair, one key can be easily derived or computed using the other key.
Asymmetric encryption differs from symmetric encryption in that it employs two separate keys for encryption and decryption. These keys are known as the public key and the private key and work together to create a public-private key pair.
The private key is kept a secret, whereas the public key is freely distributed. In this encryption technique, anyone can use a public key to encrypt a message, but only the receiver, who also has access to their corresponding private key, can decrypt it.
The public and private keys are linked by complex mathematical processes, but the keys themselves are long strings of seemingly random numbers and symbols.
To enable SSH connection on your Linux system, you will make sure that the client and server are configured on your local and remote servers.
Now, perform the following steps to enable an SSH connection on a Linux system:
Update system repositories and install the OpenSSH client if it is not installed on your Linux system:
$ sudo apt update $ sudo apt install openssh-client
The SSH client by default pre-installed on most of the Linux distributions.
To accept SSH connections, you will need to install an OpenSSH server on your Linux system. SSH server is not installed by default on Ubuntu 22.04. However, you can install the OpenSSH server from the Ubuntu apt repository and then enable the other SSH connections. Use the below command to install the OpenSSH server on a Linux system:
$ sudo apt install openssh-server
Verify the SSH service running status using the ‘systemctl’ command:
$ sudo systemctl status ssh
The ‘systemd’ unit manages all services on Ubuntu distributions. Similarly, if you can manage the SSH service (start or stop an SSH service) with the following commands:
$ sudo systemctl start ssh $ sudo systemctl stop ssh
If the service is not running properly on your system, you can enable and restart the SSH service on your Linux system:
$ sudo systemctl enable ssh $ sudo systemctl restart ssh
Linux SSH connection listens at the port of 22. Therefore, allow the firewall UFW port settings to enable SSH for remote access configuration.
$ sudo ufw enable
Now, allow access to remote SSH connections at port 22 in the UFW firewall using the following command:
$ sudo ufw allow 22/tcp
Once you enable SSH via the terminal, you make it to initiate the remote SSH connections and can accept the incoming SSH remote client connection requests. Use the ssh command to connect to the remote server:
$ssh user-name@IP-address/remote-hostname
For example, here, we will use the SSH command to connect to a server with an IP address (enter your IP address) as the user ‘hostname.’ Enter SSH via terminal:
Congratulations! Now, your server is ready to accept SSH remote connection requests from other SSH clients.
PuTTY is an open-source terminal emulator. It is a free and cross-platform software that works for both Windows and Linux users.
As a popular SSH client, PuTTY acilitates secure connections to remote machines, irrespective of the underlying operating system. The primary function of PuTTY is to provide a text-based user interface to securely connect to remote servers. In this regard, it supports a range of protocols, including SSH, Telnet, rlogin, and SCP.
Using PuTTY, you can easily connect your Unix shell environments from Windows. Linux systems typically come equipped with built-in SSH command support, yet many Linux users still opt for the PuTTY application when establishing SSH connections with remote servers.
PuTTY is not pre-installed on most of the Linux distributions. However, you can install PuTTY on the Linux system using the terminal.
If you don’t already have an installation of PuTTY on your Linux system, you can manually download it from its official PuTTY Download page. Here, you will need to select the Unix or Linux installer from the Package files.
Follow the below steps to install PuTTY on the Ubuntu 22.04 Linux distribution.
PuTTY is also available in the Ubuntu Universe Repository. So, you can also install it from there.
Here, we will install PuTTY on the Ubuntu 22.04 Linux system. Before starting the installation, make sure the Ubuntu Universe repository is added and enabled on your system.
First, add the Ubuntu universe repository using the following command:
$ sudo add-apt-repository universe
Once the repository is added and enabled, it is recommended to refresh all system repositories using the below command:
$ sudo apt update
Now, install PuTTY on Ubuntu 22.04 with the following command:
$ sudo apt install putty
Once you complete the PuTTY installation, you can start and use PuTTY on your Ubuntu system. You can launch PuTTY on Linux using the application search bar. Type ‘PuTTY’ in the search bar, and you will see the PuTTY application icon under the search results.
Using PuTTY, you can connect to any remote server or machine. In this section, we will show you how to connect to a remote Ubuntu Linux server using PuTTY.
In this guide, we will use Ubuntu 22.04 as a remote SSH Linux Server.
As we can see from the above screenshot, the folder is created on a remote Linux server. Now, cancel this window to close the session.
SSH is vital in today's digital era, ensuring encrypted, secure communications between devices. From understanding its intricate workings to initiating connections with remote servers, its significance is undeniable. Its adaptability in systems like Linux and accessibility through tools like PuTTY underscore its importance.
This guide has provided valuable insights into the process of accessing SSH remotely and leveraging its advantages. After all, as digital communication continues to grow, mastering SSH remains crucial for secure and reliable data exchange.
At Bluevps, we take pride in offering a variety of Linux VPS plans tailored to help you make the most of SSH's exceptional qualities. Our commitment is to deliver outstanding hosting experiences with high-quality Linux VPS solutions that prioritize security and performance.
Start for free and unlock high-performance infrastructure with instant setup.
Your opinion helps us build a better service.