How to install SSH on Ubuntu

Installing SSH (Secure Shell) is a straightforward process that enables secure remote access to your system.

Here’s how to install and enable SSH on Ubuntu.

1. Update Package List

sudo apt update

2. Install OpenSSH Server

sudo apt install openssh-server -y

This installs the SSH server, allowing others to connect to your machine via SSH.

3. Check SSH Service Status

sudo systemctl status ssh

You should see active (running).

If it’s not running, try the following commands:

sudo systemctl start ssh
sudo systemctl enable ssh

This starts the SSH service and ensures it starts automatically at boot.

4. Get Your IP Address (to Connect Remotely)

ip a

Look for something like: inet 192.168.x.x

5. Allow SSH Through Firewall

sudo ufw allow OpenSSH
sudo ufw reload

6. . Connect from Another Machine

ssh username@your-ubuntu-ip

Replace username with your Ubuntu username and your-ubuntu-ip with the actual IP. Example:

ssh [email protected]

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top