Enable SSH root login on CentOS Stream 9 System

After fresh system installation the root login on the CentOS Stream 9 is disabled by default. When attempt to login as root user to CentOS Stream 9 the access will be denied (access denied).

login as: rootroot@192.168.1.151’s password:Access deniedroot@192.168.1.151’s password:

This article describes How to Enable SSH root login on CentOS Stream 9 System.

[root@LinuxCNF ~]# cat /etc/redhat-releaseCentOS Stream release 9[root@LinuxCNF ~]#

To enable remote SSH login for a root user on CentOS Steam 9, need to configure SSH server. Follow the below steps to allow remote login for root user. But this is not recommended on/for production server.

Step 1: Configure SSH Server: Run the following command to edit /etc/ssh/sshd_config and change the following line from PermitRootLogin prohibit-password to PermitRootLogin yes (line 40)

[root@LinuxCNF ~]# vi /etc/ssh/sshd_config……………………….PermitRootLogin yes……………………….[root@LinuxCNF ~]#

Step 2: Restart SSH Service: Once changes have made, run the following command to restart SSH service:

[root@LinuxCNF ~]# systemctl restart sshd[root@LinuxCNF ~]#

Step 3. Validate Login Status: Now try to login with root user from remote machine/client:

login as: rootroot@192.168.1.151’s password:Last failed login: Sat Jan  1 18:01:21 IST 2022 from 192.168.1.102 on ssh:nottyThere were 2 failed login attempts since the last successful login.Last login: Sat Jan  1 17:55:32 2022 from 192.168.1.102[root@LinuxCNF ~]#

Done!!! After the changes now login successful with 2 failed login attempts.

Leave a Reply

Your email address will not be published. Required fields are marked *

RELATED POST

How to automatically restart Linux services with Systemd

Getting your Linux deployments working reliably is of paramount concern for production applications. One way to guarantee that a service…

How to Install SFTPGo on Ubuntu 22.04

Setup UFW Firewall For security reasons, it is recommended to install and configure the UFW firewall in your system. First,…

Executing Bash Scripts at Startup in Ubuntu Linux

Creating a Bash script in Ubuntu To create a Bash script in Ubuntu, you can use any text editor of…

How To Clear PHP’s Opcache

PHP can be configured to store precompiled bytecode in shared memory, called Opcache. It prevents the loading and parsing of PHP…