How to Install OpenSSH Server on Linux Mint 21

In this tutorial you will learn how to install openssh server on Linux mint 21.

Step 1 - Update your system

To make sure your system is updated before you install something on it run the update command below

 sudo apt update

Step 2 - Install OpenSSH

Run the command below to Install openssh server

sudo apt install openssh-server

Step 3 - Enable SSH

Once you have installed openssh-server, now you need to enable ssh server so when you reboot or turn on your computer the ssh server will start automatically

sudo systemctl enable ssh

Once you run the above command, you should see a similar output like the one below

Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ssh

This means the ssh server is enabled.

Step 4 - Configure Firewall to allow SSH

SSH uses port 22.

Depending on your firewall configuration, if your firewall is blocking port 22 you may not be able to connect to your ssh server, so in order to be able to connect to port 22 run the command below

Allow ssh connection

sudo ufw allow ssh

Enable new configuration

sudo ufw reload

Now you should be good to go and try to connect to your server

Connecting to SSH

You can connect to your server through ssh protocol by simply using the terminal or any other third party software such as filezilla

ssh root@192.168.0.0

Replace root with your username and the IP address with yours

What is my SSH server IP?

Since you are installing openssh server on your local computer, this means the IP of the ssh server is going to be the IP that your computer uses.

If you don't know the IP of your computer, you can easily find it by using the ifconfig command

ifconfig

And you should see a similar output. For example: In the screenshot below you can see inet which starts with 192.168.0.0 is the IP address of the computer.

So to connect to your server using ssh protocol the IP should look like this 192.168.0.0:22

Conclusion

In this tutorial you learned how to install OpenSSH server on Linux Mint 21.