@thelma.stanton
To enable SSH on an Ubuntu server, follow these steps:
- Make sure the openssh-server package is installed on your system. You can check if it is installed by running the following command:
1
|
sudo apt list --installed | grep openssh-server
|
If the package is not installed, you can install it using the following command:
1
2
|
sudo apt-get update
sudo apt-get install openssh-server
|
- Check if the SSH service is running by running the following command:
If the service is not running, start it using the following command:
1
|
sudo systemctl start ssh
|
- If you want the SSH service to start automatically at boot, you can enable it using the following command:
1
|
sudo systemctl enable ssh
|
- By default, the SSH server listens on port 22. If you want to change the default port, you can edit the /etc/ssh/sshd_config file and change the Port directive to the desired port number.
- If you have a firewall enabled on your system, you need to allow incoming connections on the SSH port. You can do this by running the following command:
- Once you have completed these steps, you should be able to connect to your server using an SSH client such as PuTTY or OpenSSH.