Ubuntu, Debian, Kali Ssh Installation


I want to connect my Linux server securely. Security is important nowadays. OpenSSH is a secure shell for remote connections. OpenSSH is very popular and have very life saver features.

Installation

Installation of ssh is like below. ssh full package name is Openssh-server which provides daemon, client and auxiliary tools for ssh.

Ubuntu, Debian, Mint, Kali:

$ sudo apt-get install openssh-server
Ubuntu, Debian, Mint, Kali
Ubuntu, Debian, Mint, Kali

CentOS, Fedora, RedHat:

$ sudo yum install openssh-server

Start Ssh Service

After installation if service is not started by default. We can start ssh service with different methods but the most basic way is using  init.d system.

$ sudo /etc/init.d/ssh start
Start Ssh Service
Start Ssh Service

Get Status of Ssh Service

After the service is started we can check the service status with the status command for  init.d. This will list some information like process ID, memory usage, CPU usage.

$ /etc/init.d/ssh status
Get Status of Ssh Service
Get Status of Ssh Service

Enable SSH Firewall Rule

Firewalls are used to protect servers for attacks.One of the main function is blocking port access. Default Ubuntu installation enables firewall named `ufw`. We will create a rule for `ufw` with the following command.

$ ufw allow ssh
Enable SSH Firewall Rule
Enable SSH Firewall Rule

Generate Ssh Key

SSH uses public and private keys. By default SSH do not generate SSH keys by default. We can create SSH keys with the ssh-keygen like below.

$ ssh-keygen
Generate Ssh Key
Generate Ssh Key

We see from screenshot that RSA key pair is created by default. Created keys are stored  in the user home .ssh directory.

Connect SSH Server

Now we will made a test connection to the SSH server by providing the host name or IP address.

$ ssh 192.168.142.144
Connect SSH Server
Connect SSH Server

 

Ubuntu, Debian, Kali Ssh Installation Infografic

Ubuntu, Debian, Kali Ssh Installation Infografic
Ubuntu, Debian, Kali Ssh Installation Infografic

LEARN MORE  What Is Computer Hardware and Components?

Leave a Comment