How to Install SSH Server on Linux

Install SSH Server on Linux

In this guide, we’ll walk you through the steps to install and configure an SSH server on Linux, covering both Debian-based and Red Hat-based systems. SSH provides secure remote access to your system, making it an essential tool for system administrators and anyone working with remote servers.

Installing on Ubuntu/Debian Systems

sudo apt update
sudo apt install openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh

On Fedora, CentOS, and RHEL

sudo dnf install openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd

The SSH server listens on port 22. If your Linux server is behind a firewall, make sure to open TCP port 22 to allow SSH connections.