Enable SSH on Debian 9

SSH stands for Secure Shell Service which allows secure remote login and other network operations. In this tutorial, you will learn how to enable SSH on Debian Desktop. By using ssh you can connect to your computer remotely, access files and perform administrative tasks.

Prerequisites

Before you start to enable SSH on Debian 9. You must have the non-root user account on your server with sudo privileges.

Install SSH On Ubuntu

Here you will install SSH from Ubuntu repository. It’s very much easier to install SSH on Debian.

Update apt package manager index by typing following command.

sudo apt update

You will need to install OpenSSH-Server (OpenBSD Secure Shell) which is available in Ubuntu universal repository. Type following command to install OpenSSH Server.

sudo apt install openssh-server

Now you will get prompt for the password, just enter the password.

When you install ssh it will be automatically started. To confirm installation type following command in terminal, it will print status of ssh service.

sudo systemctl status ssh

Output should be

Output
Active: active (running) :

Now press q to go back to the terminal.

Editing SSH Configuration File

You can edit ssh configuration according to your requirements. To edit SSH configuration enter following command.

sudo nano /etc/ssh/sshd_config

If you have not installed nano then you can also use Gedit Text Editor which comes by default in Ubuntu.

sudo gedit /etc/ssh/sshd_config

After editing file save and close Gedit.

Using SSH With LAN

If you want to connect your Debian Desktop in LAN then you should enter the following command in terminal