How to install SSH on Ubuntu 26.04

How to install SSH on Ubuntu 26.04

In this blog post, we will show you how to install SSH on Ubuntu 26.04. SSH (Secure Shell) is a cryptographic network protocol for operating network services securely over an unsecured network. SSH enables secure data transfer between two machines (server-to-server or server-to-local computer) to ensure data is transferred without interruption. In addition to installing the SSH server, this post will cover SSH configuration and the most commonly used SSH commands, with examples.

Installing and configuring SSH on Ubuntu 26.04 is a straightforward and takes a couple of minutes. Let’s get started.

Prerequisites

  • An Ubuntu 26.04 VPS is required if you want to learn how to install SSH on Ubuntu 26.04.
  • User privileges: root or non-root user with sudo privileges

Update the system

Before we start installing the OpenSSH server, we need to update the packages to their latest versions. To do that, execute the following command, which is a crucial step for how to install SSH on Ubuntu 26.04.

apt update -y && apt upgrade -y

Install OpenSSH server

OpenSSH is an open-source implementation of the SSH protocol. To install OpenSSH, execute the following command as part of the process for getting SSH installed on Ubuntu 26.04.

apt install openssh-server -y

Once installed, start and enable the ssh service:

systemctl start ssh && systemctl enable ssh

The output should look like this:

root@test.vps:~# systemctl start ssh && systemctl enable ssh
Synchronizing state of ssh.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable ssh
Created symlink '/etc/systemd/system/sshd.service' → '/usr/lib/systemd/system/ssh.service'.
Created symlink '/etc/systemd/system/multi-user.target.wants/ssh.service' → '/usr/lib/systemd/system/ssh.service'

To check the status of the server, execute the command below. This command is helpful whenever you’re figuring out how to install SSH on Ubuntu 26.04.

systemctl status ssh

If everything is OK, you should receive output similar to this:

root@test.vps:~# systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/usr/lib/systemd/system/ssh.service; enabled; preset: enabled)
Active: active (running) since Fri 2026-01-16 19:22:02 UTC; 40s ago
Invocation: 0de63cb6d6a34434b941fd05f3da1e03
TriggeredBy: ● ssh.socket
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 10147 (sshd)
Tasks: 1 (limit: 1857)
Memory: 1.4M (peak: 2.1M)
CPU: 24ms
CGroup: /system.slice/ssh.service
└─10147 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Jan 16 19:22:02 test.vps systemd[1]: Starting ssh.service - OpenBSD Secure Shell server...
Jan 16 19:22:02 test.vps sshd[10147]: Server listening on 0.0.0.0 port 22.
Jan 16 19:22:02 test.vps sshd[10147]: Server listening on :: port 22.
Jan 16 19:22:02 test.vps systemd[1]: Started ssh.service - OpenBSD Secure Shell server.

As you can see from the output above, the SSH service is listening on port 22, which is a well-known port for hackers and should be changed a make our server more secure. Changing the port and other parameters will be explained in the next section on SSH configuration. Let’s move on.

Configure the SSH Server

To change the port of the SSH server from port number 22 to a more complex number, for example, to port 4422, we need to open the following file. This process is often included in guides about how to install SSH on Ubuntu 26.04 for security reasons.

nano /etc/ssh/sshd_config

Find the following line “#Port 22“, uncomment it, and change the number to 4422

Port 4422

Save the file, close it, and restart the SSH server for the changes to take effect.

systemctl daemon-reload

systemctl restart ssh

Now lets execute the status command related to your Ubuntu 26.04 SSH configuration.

systemctl status ssh

You should see the changed port in the bolded lines below:

root@test.vps:~# systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/usr/lib/systemd/system/ssh.service; enabled; preset: enabled)
Active: active (running) since Fri 2026-01-16 19:32:47 UTC; 1min 42s ago
Invocation: 637a3240c94a40e6887104c3f95afb36
TriggeredBy: ● ssh.socket
Docs: man:sshd(8)
man:sshd_config(5)
Process: 10429 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 10431 (sshd)
Tasks: 1 (limit: 1857)
Memory: 1.5M (peak: 2.1M)
CPU: 47ms
CGroup: /system.slice/ssh.service
└─10431 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Jan 16 19:32:47 test.vps systemd[1]: Starting ssh.service - OpenBSD Secure Shell server...
Jan 16 19:32:47 test.vps sshd[10431]: Server listening on 0.0.0.0 port 4422.
Jan 16 19:32:47 test.vps sshd[10431]: Server listening on :: port 4422.
Jan 16 19:32:47 test.vps systemd[1]: Started ssh.service - OpenBSD Secure Shell server.

If we want to make more changes in the /etc/ssh/sshd_config for better server security, like enabling password authentication and Root Login, uncomment these lines to look like this. This modification is a step in the broader task of how to install SSH on Ubuntu 26.04 and harden your server.

PasswordAuthentication yes

PermitRootLogin yes

Again, after every change, reload the daemon and restart the SSH server:

systemctl daemon-reload

systemctl restart ssh

SSH Commands

Here’s a list of the most commonly used SSH (Secure Shell) and related terminal commands with practical examples, all of which you can use after following the steps on how to install SSH on Ubuntu 26.04.

1. Connect to a remote server (SSH)

ssh user@hostname - hostname

OR

ssh user@192.168.0.1 - IpAddress

2. Connect using a specific port - Connect to the SSH server on port 4422 instead of the default 22

ssh root@192.168.0.1 -p 4422

3. Use a specific private key - Tells SSH which identity (private key) file to use for authentication.

ssh -i ~/.ssh/mykey.pem root@192.168.0.1 -p 4422

4. Verbose mode for debugging - Shows detailed output of the connection process; use -vv or -vvv for even more detail.

ssh -v root@192.168.0.1 -p 4422

5. Enable compression - Compresses data during the session, helpful on slow networks.

ssh -C root@192.168.0.1 -p 4422

6. Forward the SSH agent - Allows the remote server to use your local SSH agent for further connections.

ssh -A root@192.168.0.1 -p 4422

Conclusion

That’s it. You successfully installed and configured the SSH service on Ubuntu 26.04 OS.

Of course, you don’t have to install it yourself if you have difficulty and are not familiar with Linux or SSH services. You can always contact our technical support. You only need to sign up for one of our NVMe VPS plans and submit a support ticket. We are available 24/7 and will address your request immediately.

If you liked this post teaching you how to install SSH on Ubuntu 26, please share it with your friends or leave a comment down below.

Leave a Comment