Secure Shell (SSH) is a popular network protocol used to remotely log in and share file transfers between your computer (the client) and the service (the server). It works across different operating systems, which means it also will work on Ubuntu Linux. So if you have a great desktop running Ubuntu, or a great Linux laptop and want to use SSH, all you have to do is fire up a Terminal and run a few commands. We'll guide you through the process right here.
How to enable SSH on Ubuntu
By default, Ubuntu can use SSH to connect to other devices but to use the same protocol to connect to your Ubuntu installation, we'll need to get the SSH server up and running. To install and run the SSH server on Ubuntu, you'll need sudo permissions, network connectivity, and access to the terminal. Once you confirm you have all three of those, you can begin with the steps below.
- Open Terminal.
-
Update your repository:
sudo apt update
- Enter your password.
-
Install OpenSSH:
sudo apt install openssh-server -y
- Enter your password.
-
The SSH server will start running automatically. You can confirm it's running with the command:
sudo systemctl status ssh
-
If the SSH server is not running, type the following command to allow SSH through the firewall:
sudo ufw allow ssh
How to start/stop SSH server
- Open Terminal.
-
To start the SSH server:
sudo systemctl start ssh -
To restart the SSH server:
sudo systemctl restart ssh -
To stop the SSH server:
sudo systemctl stop ssh
How to connect to Ubuntu via SSH
Once SSH has been installed on your Ubuntu installation, you can connect to the system using the protocol on another device. All you need to log in is the IP address and credentials.
- Find your IP address (where the SSH server is running): ip a
- Connect to the Ubuntu system using SSH (replacing USER and IP_ADDRESS) on another device: ssh USER@IP_ADDRESS
- Agree to the authenticity notice: yes
- Enter the password for the chosen Ubuntu account.
We hope you found this guide helpful, but keep in mind Ubuntu is pretty friendly towards developers in general. Other than SSH, you also can use other apps like Java, and even MySQL on Ubuntu. It's a great open-source operating system, and it can do so much for you. But if you're not familiar, you can check out our guide to Ubuntu to learn more.
