How to install and configure SSH service on Ubuntu?
Installing and configuring SSH service in Ubuntu is very easy, just follow these steps:
- Install SSH service:
Open the terminal and enter the following command to install SSH service:
sudo apt update
sudo apt install openssh-server
- Setting up SSH service:
Once the SSH service is installed, it will automatically start up by default, and the configuration file is located at /etc/ssh/sshd_config. You can edit this file as needed to configure the SSH service.
sudo nano /etc/ssh/sshd_config
In the configuration file, you can modify settings such as the port number of the SSH service, allowed users, login methods, and key authentication.
- To restart the SSH service:
After modifying the configuration file, it is necessary to restart the SSH service in order for the changes to take effect. Enter the following command to restart the SSH service:
sudo systemctl restart sshd
The SSH service is now installed and configured. You can now connect to the Ubuntu host using an SSH client.