i cant change sshd_config. ssh direct root logins are permitted.

Operating System & Version
CENTOS 7.9 kvm [vmi304273]
cPanel & WHM Version
v92.0.9

suatkocabas

Member
Feb 3, 2021
14
3
3
Bursa
cPanel Access Level
Reseller Owner
when i run security advisor, i cant change /etc/ssh/sshd_config in terminal WHM.

i try this code. but i cant save.

Code:
sed -i '/^PermitRootLogin/s/yes/no/' /etc/ssh/sshd_config
or

Code:
vi /etc/ssh/sshd_config
Code:
#PermitRootLogin no


SSH direct root logins are permitted.
Manually edit /etc/ssh/sshd_config and change PermitRootLogin to “without-password” or “no”, then restart SSH in the “Restart SSH” area
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,399
553
273
cPanel Access Level
Root Administrator
Hey there! The Security Advisor tool is just letting you know that option is enabled in the SSH configuration, but it doesn't mean you are required to make those changes if you wanted to leave the root access configured how it is.

I would expect those changes to work if you are logged in as the root user or a reseller with full privileges. Can you run the following two commands on the system and send me the output?

Code:
ls -lah /etc/ssh/sshd_config
lsattr /etc/ssh/sshd_config
That would tell us if there are any odd permissions or access restrictions that would keep you from editing the file.