Ubuntu SSH Setup Guide
To configure SSH remote login on Ubuntu, the following steps need to be taken:
- Install OpenSSH server:
To install the OpenSSH server, type the following command in the terminal:
sudo apt update
sudo apt install openssh-server
- Configure SSH server:
By default, the configuration file for the OpenSSH server is located at /etc/ssh/sshd_config. You can edit this file to make configurations such as changing the port number the SSH server listens on and allowing specific users to login. - To start the SSH service:
After installing the OpenSSH server, it will start automatically. If you need to manually start or stop the SSH service, you can use the following command:
sudo systemctl start ssh
sudo systemctl stop ssh
- Set up firewall:
If the firewall is enabled on your Ubuntu system, you will need to configure it to allow SSH connections. The default port number for SSH is 22, so you can open that port in the firewall settings. - Remote connection:
Now you can use any SSH client to connect to the Ubuntu server. Type the following command in the terminal to connect to the Ubuntu server:
ssh username@server_ip
The username should be your username and the server_ip should be the IP address or hostname of the Ubuntu server.
After completing the above steps, you will be able to remotely log in to the Ubuntu server via SSH.