Step-by-Step Guide to Activating SSH Service on Ubuntu
How to enable ssh service in Ubuntu
In this article, we will guide you through the process of enabling the SSH service in Ubuntu. SSH, which stands for Secure Shell, is a network protocol that allows secure remote login and command execution. It is widely used for secure remote access to servers and systems. By enabling SSH, you can securely connect to your Ubuntu server from anywhere in the world, providing you with remote administration capabilities. Let’s dive into the steps to enable SSH service in Ubuntu.
Step 1: Open Terminal
The first step in enabling SSH service in Ubuntu is to open the terminal. You can do this by clicking on the “Activities” button in the top left corner of the screen, typing “Terminal” in the search bar, and then clicking on the Terminal application.
Step 2: Check if SSH is installed
Before enabling the SSH service, you need to check if it is already installed on your system. To do this, type the following command in the terminal:
“`
sudo dpkg-query -l | grep openssh-server
“`
If the output shows the package “openssh-server” installed, you can proceed to the next step. If not, you will need to install it using the following command:
“`
sudo apt-get install openssh-server
“`
Step 3: Enable SSH service
Once SSH is installed, you need to enable the SSH service to ensure it starts automatically on system boot. To do this, use the following command:
“`
sudo systemctl enable ssh
“`
This command creates a symbolic link to the SSH service unit file in the `/etc/systemd/system/multi-user.target.wants/` directory, enabling the service to start on boot.
Step 4: Start SSH service
After enabling the SSH service, you need to start it to ensure it is running. Use the following command:
“`
sudo systemctl start ssh
“`
This command starts the SSH service immediately.
Step 5: Verify SSH service status
To verify that the SSH service is running, use the following command:
“`
sudo systemctl status ssh
“`
The output should indicate that the SSH service is active (running).
Step 6: Configure SSH settings (optional)
If you want to configure additional SSH settings, such as changing the default port or setting up key-based authentication, you can edit the SSH configuration file located at `/etc/ssh/sshd_config`. Use a text editor like `nano` or `vim` to open the file:
“`
sudo nano /etc/ssh/sshd_config
“`
Make the necessary changes to the configuration file and save the changes. Restart the SSH service for the changes to take effect:
“`
sudo systemctl restart ssh
“`
Conclusion
In this article, we have provided a step-by-step guide on how to enable the SSH service in Ubuntu. By following these instructions, you can securely connect to your Ubuntu server from anywhere in the world and perform remote administration tasks. If you encounter any issues, make sure to check the system logs for any error messages that might help you troubleshoot the problem. Happy remote accessing!