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.

RELATED POST

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…

iLO port configuration on HP servers + license

HP Integrated Lights-Out (iLO) Advanced License 34RQQ-6D5R4-G8NW3-LBMG6-MLJXR325WC-J9QJ7-495NG-CP7WZ-7GJMM iLO 2 Advanced features have been activated License Key: License Key: 35DPH-SVSXJ-HGBJN-C7N5R-2SS4W32Q8Y-XZVGQ-4SGJB-4KY3R-M9ZBN –…