Installing OpenSSH on Ubuntu 24.04
OpenSSH on Ubuntu 24.04 lets you securely control your computer from another room or network by creating an encrypted connection. It is the standard tool for remote logins and safe file transfers that keeps your data private.
You can set up this connection in just a few minutes using the Ubuntu terminal. Once installed, it blocks direct root logins by default with the setting `PermitRootLogin prohibit-password` to keep your system safe from hackers.
Install OpenSSH server on Ubuntu 24.04 by opening the terminal and running ‘sudo apt update’ followed by ‘sudo apt install openssh-server’. This enables secure remote access to your machine.
Install OpenSSH server
OpenSSH packages are available in Ubuntu default repositories so there’s no need to install additional packages.
Run the command below to install OpenSSH server.
sudo apt update
sudo apt install openssh-server
Once installed, access is granted to users on the computer. Users with valid credentials can then log on.
Configure OpenSSH
You can configure the OpenSSH server on Ubuntu 24.04 by editing the `sshd_config` file located at `/etc/ssh/sshd_config`. Tweaking options inside this file blocks the root user (the all-powerful administrator account) from logging in unchecked. This protection helps guard your system from unauthorized access.
As mentioned, the root user cannot log on by default when you install OpenSSH server using a password, due to the [PermitRootLogin prohibit-password] setting. However, you can further enhance your device security by prohibiting the root account from logging in via other means.
To do that, open the OpenSSH configuration file by running the command below.
To stop the root user from logging on, change the `PermitRootLogin` setting. You will find this setting by uncommenting and changing the highlighted line to `no`. This change helps make your server more secure.
#line 33
PermitRootLogin no
Save and exit.
Then, restart OpenSSH server.
sudo systemctl restart ssh
Access OpenSSH server
After setting up the OpenSSH server on your Ubuntu 24.04 computer, you can access it from other devices using its network name or address. Windows 11 users can fire up the Terminal app and run the `ssh` command directly. Anyone preferring a graphical tool can download PuTTY, plug in the server hostname, and log in with valid user credentials.
On Windows 11, open the Terminal app and run the ssh command.
ssh richard@srv1.example.com
Using PuTTY, enter the server hostname and click Open.

Access should be granted after entering the correct username and password.

That should do it!
Conclusion:
Wrapping up, getting OpenSSH running gives your server a reliable security baseline. Encrypted connections keep traffic private, while disabled root password logins fend off automated attacks. Reviewing these access methods periodically keeps the server locked down against unauthorized entry.
- OpenSSH provides secure access to servers through encrypted connections.
- Password authentication is enabled by default upon installation, simplifying the login process.
- For improved security, the root account is prohibited from logging in with password authentication.
- Configuration adjustments in the
/etc/ssh/sshd_configfile can further enhance security. - Remote access is possible using SSH commands or tools like PuTTY.
- Ensuring you manage your user accounts and authentication methods is crucial for maintaining a secure server environment.
Setting up the OpenSSH server on Ubuntu 24.04 creates a strong, secure connection. This process helps you tailor security settings to your specific needs.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
[…] How to install OpenSSH server on Ubuntu […]