How to Enable SSH Service on Rocky Linux 8 / CentOS 8

Enable SSH Service on Rocky Linux 8

The following article will explain how to install and start SSH service on Rocky Linux 8, RHEL 8 / CentOS 8 system. SSH is a client-server service providing secure encrypted connections over the network connection.

In this tutorial you will learn:

  • How to Install SSH service.
  • How to start SSH service.
  • How to enable SSH to start after reboot.
  • How to open SSH port 22 for incoming traffic.

Software Requirements and Conventions Used

CategoryRequirements, Conventions or Software Version Used
SystemRocky Linux 8, RHEL 8 / CentOS 8
SoftwareN/A
OtherPrivileged access to your Linux system as root or via the sudo command.
Conventions# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Enable ssh service on Rocky Linux step by step instructions

Install the openssh package:

# dnf install openssh-server

Start the OpenSSH service by executing the following command:

# systemctl start sshd

Check the status of the sshd service.

# systemctl status sshd 
● sshd.service - OpenSSH server daemon 
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled) 
   Active: active (running) since Fri 2018-11-16 22:08:39 EST; 1 day 21h ago 
   Docs: man:sshd(8) 
         man:sshd_config(5) 
   Main PID: 979 (sshd) 
   Tasks: 1 (limit: 24007) 
   Memory: 6.6M

Enable the SSH service to start after the reboot:

# systemctl enable sshd

Open the firewall rules to accept incoming traffic on SSH port 22:

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

Connect to the SSH server with IP eg. 10.1.1.1 as the root user from a remote client machine:

$ ssh [email protected]

1 Trackback / Pingback

  1. Enable SSH Service on Rocky Linux 8 / CentOS 8 – itsrockylinux

Leave a Reply

Your email address will not be published.


*