Home bread crumb arrow icon Tutorials bread crumb arrow icon How to Enable and Disable SSH on AlmaLinux

How to Enable and Disable SSH on AlmaLinux

Enable and Disable SSH on AlmaLinux
Richard (Senior Manager)
Study duration : 4 Minutes
0 Comment
2026/02/10

SSH on AlmaLinux is the default way most admins access and manage their servers. From running commands to basic system maintenance, almost everything happens over an SSH connection. This article shows how to enable and disable SSH on AlmaLinux using systemctl, and what to check if the service or firewall blocks access.

SSH Access on AlmaLinux

Most AlmaLinux servers are managed entirely over SSH. It’s how you connect, run commands, and control the system without direct access.

In the sections below, we’ll show how to enable or disable SSH on AlmaLinux and make sure the service is working as expected.

Enable SSH on AlmaLinux

To enable SSH on AlmaLinux, follow the steps below.

The first step is to install the OpenSSH packages on AlmaLinux. If you want the system to accept incoming SSH connections, the OpenSSH server package must be installed. But if you want to start outgoing connections with the ssh command, you need to install the OpenSSH-clients package. You can install both by running the following command:

dnf install openssh-server openssh-clients

Once the OpenSSH server is installed, you can manage the sshd service on AlmaLinux using systemctl. The reason for this configuration is that the SSH service can be controlled via system command. You can start or stop the SSH server using the following commands:

systemctl start sshd
systemctl stop sshd

Finally, you can use the following command to enable SSH. Doing so will automatically generate SSH on the system boot:

systemctl enable sshd

Disable SSH on AlmaLinux

In the previous section, you learned how to enable SSH. In this section, we want to teach you how to disable SSH. To do this, just need run the following command:

systemctl disable sshd

To confirm that the SSH service is running, check its status with:

systemctl status sshd

Note: Running the following commands will accept incoming connections via firewalld:

firewall-cmd --zone=public --permanent --add-service=ssh
firewall-cmd --reload

Conclusion

Being able to enable and disable SSH on AlmaLinux is a basic but important part of server management. Whether you’re securing a fresh VPS or temporarily limiting access, controlling the SSH service gives you direct control over how the server is reached.

With the commands covered in this article, you can quickly manage the SSH service on AlmaLinux and verify that it’s running only when you need it.

Share this post
0

Comments and questions