Enable SSH on CentOS 8.x and Red Hat Enterprise Securely

The SSH (Secure Shell), is a network protocol that used to operate remote logins to distant machines within a local network or over the Internet. We are going to install SSH on CentOS and connect it via remote computer.

By default, the SSH installed and ready to use in CentOS 8 and Linux Red Hat Enterprise. In case you need to install and configure it, this is what you should do to install and enable SSH on Red Hat and CentOS.

The same process works for all Linux distro, but you need to use YUM for Red Hat-based distro and APT for Debian distro. Read more about APT and YUM in Linux command line section.

Check the status of SSH before installing on your Linux computer.

Sudo systemctl status sshd
Check SSH Status CentOS and Enterprise Red Hat Linux
Check SSH Status CentOS and Enterprise Red Hat Linux

The output results indicate the status of SSH as green Active and running. You can connect remotely via another computer over the internet or local network.

Related article: Enable SSH on CentOS and Red Hat Enterprise

Install SSH on CentOS 8.x Linux

In a case when you what to install and enable SSH on CentOS or Red hat Linux, follow these steps to install and configure SSH securely.

To install the SSH server on CentOS and Red Hat Linux, you will need to haveĀ sudo privileges on your server.

Don’t forget to update your system with ( sudo yum update ) command, and make sure that your current packages are up to date for security purposes.

So good, after updating your system just type the following command to install SSH server.

sudo yum -y install openssh-server

The command result should be a complete installation process, and it set up all the necessary files for the SSH server.

Let’s check the newly installed SSH server with running the following command.

systemctl status sshd
Check SSH Status Command
Check SSH Status Command

The SSH is installed but not running. You can start the SSH server by running the following command.

sudo systemctl enable sshd
Enable SSH on CentOS 8.x Linux Server

Now the SSH server is enabled, execute the following command to run it.

sudo systemctl start sshd

Great! The SSH server is up and running. Let’s connect to this server via another computer.

Find the Linux CentOS IP address with following command.

ip a s

My CentOS machine IP address is Your might be different!

I’m testing SSH connection via Windows 10 machine using Windows PowerShell command line. You can use the terminal on Mac OS or Linux.

Type the following command to connect to CentOS Linux remotely using SSH.

ssh shais@
Connect CentOS 8.x Linux via SSH Remotely
Connect CentOS 8.x Linux via SSH Remotely

Shais is a user account in CentOS. is the CentOS IP address.

Yes, we’ve successfully connected to the CentOS machine remotely using SSH.

Leave a Comment