You may see an error like the following while performing some actions in WHM or cPanel. In this case, while enabling or disabling password authentication for SSH.
Failed to open “/etc/ssh/sshd_config”: (XID b9qyyd) The system failed to lock the immutable (+i) file “/etc/ssh/sshd_config” (as EUID: 0, EGID: 0) because of the following error: Permission denied at /usr/local/cpanel/Whostmgr/Services/SSH/Config.pm line 426.
This error can occur due to the file referenced in the error having the immutable bit set. To check for this, you can run the following command.
In the case of the error above, the command and output would look like the following.
# lsattr /etc/ssh/sshd_config
If "i" is present in the attributes section as above, the file is immutable, which means it can not be altered in any way.
To remove the immutable attribute, you can run the following command on the file.
chattr -i /path/to/file
In this example, the command would be the following.
chattr -i /etc/ssh/sshd_config