@monroe.bahringer
To configure SSH access on Ubuntu, you can follow these steps:
- Install the SSH server:
Open the terminal and run the following command:
1
2
|
sudo apt-get update
sudo apt-get install openssh-server
|
- Check the status of the SSH service:
1
|
sudo systemctl status ssh
|
This command should show you whether the SSH server is running or not.
- Configure SSH access:
Edit the SSH configuration file using your favorite text editor (nano, vim, etc.)
1
|
sudo nano /etc/ssh/sshd_config
|
Make the following changes:
- Change the port number (optional) to a different port than the default 22 for security reasons.
- Set PermitRootLogin to no to disable SSH access for the root user.
- Set PasswordAuthentication to no to disable password-based authentication and use only SSH keys for authentication.
Save the changes and close the file.
- Restart the SSH service:
1
|
sudo systemctl restart ssh
|
- Configure firewall rules:
If you have a firewall enabled on your Ubuntu server, make sure to open the SSH port (default 22 or the one you set in step 3) to allow incoming connections:
That's it! You should now be able to connect to your Ubuntu server using SSH.