Installing OpenSSH on Ubuntu 24.04
You install OpenSSH on Ubuntu 24.04 by opening your terminal and executing the `sudo apt update && sudo apt install openssh-server` commands.
OpenSSH provides a secure, encrypted way for you to remotely access and manage your Ubuntu computer over a network. It’s the standard tool for secure shell (SSH) connections, file transfers (SCP, SFTP), and tunneling.
Once installed, the OpenSSH server on Ubuntu 24.04 defaults to enabling password authentication, allowing you to log in with your username and password immediately. For added security, direct root login with passwords is often disabled by default, typically set to `PermitRootLogin prohibit-password` in the SSH configuration.
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
After installing OpenSSH server, its default configuration file is located at [/etc/ssh/sshd_config].
You can enhance your device’s security by tweaking the settings in this configuration file. An example would be denying the root account login without password authentication.
As mentioned, the root user can’t 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.
sudo nano /etc/ssh/sshd_config
Then, uncomment and change the highlighted line to [no] to prevent the root user logging on.
#line 33
PermitRootLogin no
Save and exit.
Then, restart OpenSSH server.
sudo systemctl restart ssh
Access OpenSSH server
Now that you’ve set it up, you can access OpenSSH from remote systems using the server’s IP address or hostname.
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:
So, installing and configuring the OpenSSH server on Ubuntu 24.04 is a process that enhances your server’s security. Here are the key points to remember:
- 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.
Follow these steps to set up a strong and secure OpenSSH server tailored to your 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 […]