Photo by Gabriel Heinzer on Unsplash
Secure Shell (SSH) is a protocol used to securely connect to a remote computer. In this guide, we’ll show you how to connect to an Ubuntu server from another computer using SSH.
Install SSH
By default, SSH is not installed on all Ubuntu installations. To ensure it’s installed, open a terminal on your Ubuntu system and enter the following command:
sudo apt-get update
sudo apt-get install openssh-server
Start the SSH Service
After installing SSH, start the service with this command:
sudo systemctl start ssh
You can check if SSH is running with this command:
sudo systemctl status ssh
Find Your IP Address
To connect to your Ubuntu system, you’ll need its IP address. Use this command to find it:
hostname -I
This will return your IP address.
Connect from Another Computer
On another computer (Windows, Mac, or another Linux system), open a terminal or an SSH client and use the following command to connect to your Ubuntu system:
ssh username@your_ip_address
Replace username
with your Ubuntu username
, and your_ip_address
with the IP address you found in the previous step.
Trust the SSH Connection
The first time you connect to your Ubuntu system via SSH, you’ll be asked to confirm the connection’s authenticity. Type yes
and press Enter to proceed.
Use SSH
Once connected, you can execute commands, transfer files, and manage your Ubuntu system remotely. To exit, type exit
and press Enter
.