how to enable ssh in ubuntu

How to Enable SSH in Ubuntu

Secure Shell (SSH) is a widely used protocol for secure remote access to a Linux system. Ubuntu, a popular Linux distribution, comes with built-in support for SSH. In this article, we will walk you through the steps to enable SSH in Ubuntu.

Step 1: Install OpenSSH Server

The first step is to ensure that the OpenSSH server is installed on your Ubuntu system. To install OpenSSH server, open a terminal and run the following command:

sudo apt-get install openssh-server

This command will download and install the OpenSSH server package on your system.

Step 2: Start the SSH Service

Once the OpenSSH server is installed, the SSH service should start automatically. You can verify the status of the SSH service by running the following command:

sudo systemctl status ssh

If the SSH service is not running, you can start it by running the following command:

sudo systemctl start ssh

To ensure that the SSH service starts automatically at boot time, run the following command:

sudo systemctl enable ssh

Step 3: Configure Firewall

If you have a firewall enabled on your Ubuntu system, you need to allow SSH traffic through the firewall. You can do this by running the following command:

sudo ufw allow ssh

This command will enable SSH traffic through the firewall.

Step 4: Connect to the SSH Server

Once you have enabled SSH on your Ubuntu system, you can connect to the SSH server from another computer using the following command:

ssh username@server_ip

Replace username with your username on the Ubuntu system and server_ip with the IP address of the Ubuntu system.

You will be prompted to enter your password. Once you have entered the correct password, you will be connected to the SSH server.

Conclusion

Enabling SSH in Ubuntu is a straightforward process that allows you to securely access your Ubuntu system remotely. By following the steps outlined in this article, you can easily enable SSH on your Ubuntu system and start using it for remote access.

Comments