How To Install,Start, Stop, Restart OpenSSH In Ubuntu, Debian, Kali, Mint? – POFTUT

How To Install,Start, Stop, Restart OpenSSH In Ubuntu, Debian, Kali, Mint?

Ubuntu is popular Linux distributions used by millions. In order to access Ubuntu systems remotely we use ssh protocol. So in order to access and manage Ubuntu systems the ssh server should be installed and running without restriction like firewall. In this tutorial we will look how to install, start and troubleshoot SSH service in Ubuntu, Debian, Kali, Mint. We can use this tutorial distributions like Debian, Kali and Mint too because of their origin and system base are the same.

Install SSH Service

We can install OpenSSH service with different ways but the most straight forward way is using apt package manager. We will use apt install to install OpenSSh Service. This requires root privileges.

Start SSH Service

By default OpenSSh service do not starts automatically. We need to start OpenSSH service explicitly by using systemctl command. systemctl command is provided by default recent versions of Ubuntu, Debian, Kali and Mint. If it is not installed install systemctl . In order to get more details look following tutorial.

Linux Sshd Server Configuration and Security Options With Examples

Show SSH Service Status

Services starts, stops but how can we show or list current status of SSH service. We will use systemctl status command in order to list current status of the SSH.

Show SSH Service Status

Show SSH Service Status

We can see that green active (running) text that shows SSH service is running.

LEARN MORE  How To Install and Use Cygwin With Terminal and Ssh Examples

Restart SSH Service

In some situations we need to restart the SSH service. Configuration change in SSH service requires SSH restart in order to take affect. We can restart SSH service like below. This will reload SSH service with the latest SSH service configuration which resides in /etc/ssh/sshd_config .

Enable Start of SSH Service At The System Boot

After system reboots or boots the SSH service do not starts automatically and starting it explicitly is a trivial task. We can enable SSH service start automatically after system reboot.

echo '

Disable Start of SSH Service At The System Boot

If we do not need to start SSH service at the system boot  we can disable automatic start with the following command.

2 Responses

  1. 20/08/2017
  2. 11/09/2019

    […] generally ssh port. Ssh port number is know for the whole world so attackers can attack to beat our OpenSSH server like brute […]

Leave a Reply

Your email address will not be published. Required fields are marked *