Saturday, April 2, 2022

Ubuntu/Linux: Configuring a host to support ssh Connections (Installing OpenSSH Server)

By default, an Ubuntu 20.04 instance does not contain an SSH server and hence there is no ssh access to the machine. To remedy this, install OpenSSH Server by:

1) Install the OpenSSH Server package:

sudo apt-get install -y openssh-server

2) Enable the service using systemctl enable:

sudo systemctl enable ssh

3) Start the service using the systemctrl start command:

sudo systemctl start ssh

4) On a different host, verify that the port for ssh (port 22) is open using the technique described in Ubuntu/Linux: How to tell if a Port is Open on a Remote Host:

echo > /dev/tcp/ && echo "Port 22 (SSH) is open!"

When the above command is invoked and OpenSSH has been installed successfully the following is displayed:

Remember the above command is run on the client and not the host (remote computer) where OpenSSH server will run.

No comments :

Post a Comment