By default, the root account is disabled in Ubuntu for security reasons. However, if you need to enable root login via SSH, you can follow these steps:
Log in to your Ubuntu server as a user with sudo privileges.
Open the SSH configuration file
/etc/ssh/sshd_config
using your preferred text editor:bashsudo nano /etc/ssh/sshd_config
Find the following line:
bash#PermitRootLogin prohibit-password
Uncomment the line by removing the
#
symbol at the beginning and change the value toyes
:bashPermitRootLogin yes
Save and close the file by pressing
Ctrl+X
, thenY
, and finallyEnter
.Restart the SSH service to apply the changes:
sudo systemctl restart sshd
That's it! You can now log in as the root user via SSH. However, keep in mind that enabling root login via SSH can pose a security risk and should be used only when necessary. It is recommended to disable root login via SSH when it is no longer required.
No comments:
Post a Comment