Secure Shell (SSH) is a cryptographic network protocol for operating network services securely such as login, remote command-line execution, and transfer files securely. To enable SSH server on Ubuntu desktop machine, you need to be logged in as a user with sudo privileges.
SSH server is not installed by default on Ubuntu desktop operating system, So you need to install it from the standard Ubuntu repositories.
We will guide you to install SSH server on your machine in the following steps:
1- Open terminal by pressing Ctrl+Alt+T on the keyboard or by clicking on the terminal icon and type the following commands:
$ sudo apt update $ sudo apt install openssh-server
Enter the password and type y to agree for the installation.
2- After the installation is completed, SSH service will start automatically. However, if you want to verify it is running you can type the following command in the terminal that will prompt you the status of the service:
$ sudo systemctl status ssh
If it says Active: active (running) so the service is up.
press q or Ctrl + c to exit and get back to the prompt.
3- Open SSH server port through Ubuntu firewall(UFW) if it is enabled, using the following command:
$ sudo ufw allow ssh
Now you have SSH server installed and enabled on your Ubuntu machine, you can login to it using any remote SSH client.
If you want to disable SSH, you can stop SSH service by typing:
$ sudo systemctl stop ssh
To start the service again:
$ sudo systemctl start ssh
And if you want to disable the SSH service from starting during system boot:
$ sudo systemctl disable ssh
To re-enable it:
$ sudo systemctl enable ssh
Also, if you want to learn how to setup SSH key-based authentication, check out this article.
We hope you find this article helpful and if you have any question, leave a comment below.
Other articles you may find interesting