To allow the root user to use SSH (OpenSSH) on a Linux system, you need to edit the /etc/ssh/sshd_config
file and modify the PermitRootLogin
setting. By default, this setting is set to no
, which means that the root user is not allowed to log in using SSH. To allow the root user to log in, you need to change the setting to yes
like this:
PermitRootLogin yes
Once you have made this change, you need to restart the SSH server for the changes to take effect. This can be done by running the following command:
sudo service ssh restart
After restarting the SSH server, you should be able to log in as the root user using SSH. However, it is generally not recommended to allow the root user to log in using SSH, as it can pose a security risk. It is better to use a regular user account with sudo
privileges for logging in over SSH instead.