How to enable ssh on Ubuntu

In this article, we will see how to enable ssh on Ubuntu machine without restart.

1. The SSH server is not installed by default on Ubuntu desktop systems but it can be easily installed
from the standard Ubuntu repositories.

2. Install the openssh-server package by typing:

sudo apt install openssh-server

Enter the password when prompted and enter Y to continue with the installation.

How to enable ssh on Ubuntu

3. Once openssh-server is installed successfully, it automatically started.Now, verify by using below command.

sudo systemctl status ssh

● ssh.service - OpenBSD Secure Shell server Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: > Active: active (running) since Sun 2021-01-31 02:58:03 PST; 1min 35s ago Docs: man:sshd(8) man:sshd_config(5) Main PID: 3652 (sshd) Tasks: 1 (limit: 4619) Memory: 1.3M CGroup: /system.slice/ssh.service └─3652 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups Jan 31 02:58:03 PGMaster systemd[1]: Starting OpenBSD Secure Shell server... Jan 31 02:58:03 PGMaster sshd[3652]: Server listening on 0.0.0.0 port 22. Jan 31 02:58:03 PGMaster sshd[3652]: Server listening on :: port 22. Jan 31 02:58:03 PGMaster systemd[1]: Started OpenBSD Secure Shell server.