rajeshi.medium.com 2 min read Original Source

Understanding SSH: A Practical Developer’s Guide

If you are a developer then I am sure you heard about SSH. No matter how awesome your web app is, if you want people to use it then you need to put it online. And if you want your deployment process to be safe then SSH is going to be your best buddy.

In this blog, We will cover the basics of SSH and different encryption technologies. We will also see some commands so that you can safely deploy your app online.

What is SSH (Secure Shell or Secure Socket Shell)?

SSH is a protocol that allows users to access the remote server and modify them. It is a secure way to establish a connection with the remote server. It uses cryptographic techniques so that all the communication you make with the remote server is encrypted and safe. It is a secure alternative to Telnet.

With SSH, developers can access the remote server from their terminal and securely deploy their app online.

How to start with SSH?

SSH can be used directly from the terminal of your Windows, Linux, and Mac. But on older versions of windows, you need to use an SSH client like putty.

SSH Syntax

ssh {user}@{host}
ssh {user}@{host}

SSH Command

ssh root@137.44.309.64 or ssh root@xyz.com
ssh root@137.44.309.64 or ssh root@xyz.com

In the command ssh keyword instructs the computer to open an SSH connection, the user represents the account you want to access, and the host refers to the computer you want to access. The host can be an IP address or domain name.

Different Encryption Techniques In SSH

There are three different encryption techniques used by SSH:

  1. Symmetrical encryption: In Symmetric encryption, one secret key is used for both the encryption and decryption of a message by both the client and the host. The exchange of the secret key is done so that it can be used in the decryption process. Anyone possessing the key can decrypt the message being transferred. It is often called shared key or shared secret encryption.
  2. Asymmetric Encryption: Asymmetric encryption uses public and private keys. The public key is used for encryption, and the private key is used for decryption. A public key can be used by any individual to encrypt a message and can only be decrypted by the recipient who possesses their particular private key, and vice versa.
  3. Hashing: With Hashing, a unique hash value of a fixed length is generated for each input which cannot be exploited. We can easily generate a cryptographic hash from a given input, but we cannot generate the input from the hash. The recipient takes the input from the sender and applies the same hashing which was applied by the sender and compares the hashed value to verify whether they possess the correct input.

Some Basic SSH Commands

Below is the list of some basic SSH commands:

  1. ls: shows the list of all files and directories.

ls
ls

2. cd: change the directory.

cd directory_name
cd directory_name

3. mkdir: create a directory.

mkdir folder_name
mkdir folder_name

4. rm: removes a file or directory.

rm file_name.txt
rm file_name.txt

5. pwd: gives the path of your present working directory.

pwd

// Output
user/project/index.html
pwd

// Output
user/project/index.html

Thank you for reading this far. I hope you understood SSH and its importance.

If you want more web development content then follow me on Medium and subscribe to my YouTube channel

Any doubt? reach me on Twitter