How to Enable Root Login Via SSH on Ubuntu 24.10

To enable root login via SSH on Ubuntu 24.10, follow these steps:

Step 1 : Enable the Root Account

By default, the root account is disabled on Ubuntu. To enable it, set a password for the root user. Run the following command:

Set the desired password for the root account.

Step 2 : Edit the SSH Configuration File

Open the SSH configuration file for editing:

Step 3 : Modify the sshd_config File

Find the line that says #PermitRootLogin prohibit-password. Uncomment it by removing the # symbol and change the value to yes:

Step 4 : Restart the SSH Service

After making the changes, restart the SSH service to apply the new settings:

Step 5 : Test the Connection

Try connecting to your server via SSH as the root user to confirm it's working:

Congratulations! You have successfully enabled root login via SSH on Ubuntu 24.10.