How to Enable SSH in Ubuntu 24.04?

By Hardik Savani October 24, 2024 Category : Ubuntu

Hello Folks,

This post is focused on how to enable ssh in ubuntu 22.04. I explained simply step by step how to activate ssh in ubuntu 22.04. This post will give you a simple example of how to enable root ssh in ubuntu 22.04. Here you will learn how to install open ssh in ubuntu 22.04. Let's see below example ubuntu 22.04 enable ssh server.

Enabling SSH (Secure Shell) on Ubuntu 22.04 is a straightforward process. Follow these step-by-step instructions:

Step 1: Open the Terminal

- Press `Ctrl+Alt+T` to open the terminal. This is where you'll enter the commands to enable SSH.

Step 2: Install the SSH Server (if not already installed)

- In many cases, SSH is already installed on Ubuntu. However, if it's not, you can install it with this command:

sudo apt update

sudo apt install openssh-server

Enter your password when prompted.

Step 3: Enable and Start the SSH Service

- To enable SSH and start the service, use these commands:

sudo systemctl enable ssh

sudo systemctl start ssh

Step 4: Check the SSH Status (optional)

- You can check the status of the SSH service to ensure it's running correctly:

sudo systemctl status ssh

This command displays information about the SSH service, including whether it's active and running.

Step 5: Configure Firewall Rules (if needed)

- If you have a firewall (like UFW) enabled on your system, you may need to allow SSH traffic. By default, SSH uses port 22. You can allow SSH traffic with the following command:

sudo ufw allow ssh

If you haven't set up a firewall or are unsure, you can check the firewall status:

sudo ufw status

Ensure that SSH is listed as "ALLOW" in the output.

Step 6: Access Your Ubuntu Machine via SSH

- You can now access your Ubuntu machine from another computer using SSH. Replace `[username]` with your Ubuntu username and `[server_ip]` with the IP address or hostname of your Ubuntu machine:

ssh [username]@[server_ip]

For example:

ssh yourusername@192.168.1.100

- You'll be prompted to enter your Ubuntu user's password to establish an SSH connection.

That's it! SSH is now enabled and running on your Ubuntu 22.04 machine, allowing you to securely access it remotely. Ensure that you use strong and secure passwords for your Ubuntu user accounts or consider setting up SSH key authentication for even better security.

Output:

I hope it can help you...

Tags :
Shares