How to enable ssh in Ubuntu?
To enable the SSH service on Ubuntu, you need to follow these steps:
- Open the terminal: You can use the shortcut Ctrl+Alt+T to open the terminal.
- Check if the SSH client and server are installed: Run the following command in the terminal to install the OpenSSH server and client components:
sudo apt update
sudo apt install openssh-server openssh-client
- Start the SSH service: Run the following command in the terminal to start the SSH service:
sudo service ssh start
- Set up SSH service: By default, the SSH server will use default settings, but you can make some configuration changes as needed. Open the SSH configuration file:
sudo nano /etc/ssh/sshd_config
In this file, you can modify the port, allowed users, login methods, etc. After making the configuration changes, press Ctrl+X, then press Y to save the changes.
- Reload SSH Configuration: Use the following command in the terminal to reload the SSH configuration:
sudo service ssh reload
- To confirm if the SSH service is running: Use the following command to check the status of the SSH service.
sudo service ssh status
If the SSH service is running, you will see output similar to “active (running)”.
Now, your Ubuntu system has activated the SSH service, allowing other computers to connect to your system using an SSH client.