How to Enable SSH on Ubuntu

How to Enable SSH on Ubuntu (Step-by-Step Guide)

Enabling SSH on Ubuntu is essential if you want to manage your machine remotely or automate deployments. In this guide, we’ll walk through how to set it up securely.

1. Install th…


This content originally appeared on DEV Community and was authored by John Ajera

How to Enable SSH on Ubuntu (Step-by-Step Guide)

Enabling SSH on Ubuntu is essential if you want to manage your machine remotely or automate deployments. In this guide, we’ll walk through how to set it up securely.

1. Install the OpenSSH Server

Run the following commands to update package lists and install the OpenSSH server:

sudo apt update
sudo apt install openssh-server -y

This installs the SSH service and its dependencies.

2. Enable and Start the SSH Service

After installation, enable and start the SSH service so it runs on boot:

sudo systemctl enable ssh
sudo systemctl start ssh

You can verify the service is running:

sudo systemctl status ssh

Look for active (running) in the output.

3. Allow SSH Through the Firewall (Optional)

If you’re using UFW (Uncomplicated Firewall), you’ll need to allow SSH traffic:

sudo ufw allow ssh
sudo ufw reload

This opens port 22 for incoming SSH connections.

4. Test Your SSH Connection

From another machine, connect to your Ubuntu system using:

ssh your-username@your-ubuntu-ip

Replace your-username with your Ubuntu username and your-ubuntu-ip with the machine’s IP address.

5. (Recommended) Harden Your SSH Setup

For better security, consider:

  • Using SSH keys instead of passwords.
  • Disabling root login via SSH by editing /etc/ssh/sshd_config.
  • Changing the default SSH port to reduce automated attacks.

After making changes to sshd_config, restart SSH:

sudo systemctl restart ssh

Final Thoughts

That’s it! You’ve successfully enabled SSH on Ubuntu. With SSH running, you can now remotely administer your server, deploy code, and use tools like Ansible or Git to manage your machine more efficiently.


This content originally appeared on DEV Community and was authored by John Ajera


Print Share Comment Cite Upload Translate Updates
APA

John Ajera | Sciencx (2025-09-16T23:28:33+00:00) How to Enable SSH on Ubuntu. Retrieved from https://www.scien.cx/2025/09/16/how-to-enable-ssh-on-ubuntu/

MLA
" » How to Enable SSH on Ubuntu." John Ajera | Sciencx - Tuesday September 16, 2025, https://www.scien.cx/2025/09/16/how-to-enable-ssh-on-ubuntu/
HARVARD
John Ajera | Sciencx Tuesday September 16, 2025 » How to Enable SSH on Ubuntu., viewed ,<https://www.scien.cx/2025/09/16/how-to-enable-ssh-on-ubuntu/>
VANCOUVER
John Ajera | Sciencx - » How to Enable SSH on Ubuntu. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/16/how-to-enable-ssh-on-ubuntu/
CHICAGO
" » How to Enable SSH on Ubuntu." John Ajera | Sciencx - Accessed . https://www.scien.cx/2025/09/16/how-to-enable-ssh-on-ubuntu/
IEEE
" » How to Enable SSH on Ubuntu." John Ajera | Sciencx [Online]. Available: https://www.scien.cx/2025/09/16/how-to-enable-ssh-on-ubuntu/. [Accessed: ]
rf:citation
» How to Enable SSH on Ubuntu | John Ajera | Sciencx | https://www.scien.cx/2025/09/16/how-to-enable-ssh-on-ubuntu/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.