SSH, or Secure Shell, is a network protocol that enables secure remote access to servers (and other devices, but we will focus on servers) over an insecure network. SSH can be enabled on various Linux OS distributions; however, this blog post will focus on helping it on AlmaLinux 10 OS. However, the procedure is similar to that on any other Linux OS. SSH is an essential tool for system administrators, DevOps engineers, sysadmins, developers, and regular Linux users who need to remotely manage their servers. This post will cover how to install SSH on AlmaLinux 10, including configuration of basic rules, enabling SSH through the Firewall, and testing SSH connections. Understanding how to install and enable SSH on AlmaLinux 10 is a straightforward process that typically takes between 5 and 10 minutes to complete. Let’s get things working!
Prerequisites
- A server running AlmaLinux 10 OS
- User privileges: root or non-root user with sudo privileges
Step 1. Update your system
Before installing and enabling SSH, it is a good practice to update the system packages to their latest versions available. To do that, execute the following command in your terminal of AlmaLinux 10:
sudo dnf update -y && sudo dnf upgrade -y
Step 2. Install SSH Server
Most of the hosting companies are providing the servers with an installed SSH server, but if somehow the SSH server is missing, you can install it with only one command:
sudo dnf install openssh-server -y
Once installed, start and enable the sshd service for automatic start on system boot:
sudo systemctl start sshd && sudo systemctl enable sshd
To check the status of the service, you can use the command below:
sudo systemctl status sshd
You should get output similar to this:
[root@host ~]# sudo systemctl status sshd
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: enabled)
Active: active (running) since Thu 2025-06-05 17:24:01 CDT; 58s ago
Invocation: 709679b8ef3b44cdaba61fea6ec85611
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 4261 (sshd)
Tasks: 1 (limit: 23175)
Memory: 1M (peak: 1.2M)
CPU: 35ms
CGroup: /system.slice/sshd.service
└─4261 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
Now, the SSH service is started and enabled. Let’s proceed to the following paragraphs, where you will learn how to configure some basic settings.
Step 3. Configure SSH Server
After a fresh installation of the SSH server, some default settings can be edited according to the user’s needs. For example, the SSH server is typically configured to listen on port 22 by default, which can be easily exposed and may be a target of attacks. To enhance the security of your server, you can modify it by editing the /etc/ssh/sshd_config SSH configuration file, where all default and future changes are stored.
To change the SSH port 22 to port 3322, for example, you need to open the /etc/ssh/sshd_config with your favorite editor and make an edit for this line to look like this:
Port 3322
Save the file, close it, and restart the SSH service:
sudo systemctl restart sshd
After changing the SSH port, we need to enable SSH traffic through this port 3322. We will do that in iptables with the command below:
sudo iptables -A INPUT -p tcp --dport 3322 -j ACCEPT
Now, let’s create an SSH user and set a password for it so we can later test the SSH connection:
adduser lhs
Once added, let’s set a strong user password by executing the passwd lhs command. Your prompt will ask you to type your password twice.
[root@host lhs]# passwd lhs
New password: YourStrongUserPassword
Retype new password: YourStrongUserPassword
passwd: password updated successfully
These were the most basic SSH configurations, including changing the SSH port, opening it in the firewall, and creating an SSH user. Now, let’s proceed to the final step of this blog post, which involves testing the SSH connection.
Step 4. Test the SSH Connection
The SSH is enabled, configured, and we have a user to test the SSH connection. To do that, you can use your local terminal or test the connection from the remote server with the following command:
ssh lhs@ServerIP -p 3322
You will need to replace the ServerIP with the IP address of the server where you configured the SSH server, as described in this post.
That’s it. You successfully enabled the SSH service on AlmaLinux 10.
If you encounter difficulties with this installation, our Linux administrators will be happy to assist you with any aspect. You need to sign up for one of our monthly server management or per-incident server support plans. Please do not hesitate to contact us at your convenience. We are available 24/7.
If you liked this post on how to enable SSH on AlmaLinux 10, please share it with your friends or leave a comment below.