How to re-enable the root user?

As you might have noticed, the pre-installed Linux distributions do not have the root user enabled by default, but instead rely on an administrative user with sudo priviliges. While that is the recommended setup, you can of course also manually re-enable the root user if you prefer to use root directly.

To re-enable the root user:

1. Login in via the alwyzon user and run: sudo su - (After that, you are effectively root already.)
2. Run passwd and pick a password for the root user.
3. Open the file /etc/ssh/sshd_config. For example, using nano: nano /etc/ssh/sshd_config
4. Search for a line which says #PermitRootLogin no (or similar) and replace it by PermitRootLogin yes. (It's important to remove the # in front of that line too!)
5. Run service ssh restart and you are ready to login via the root user.

If you are looking for a short write-up about why using the root user directly might not be good idea, have a look at this post on StackExchange: "Serverfault: What's wrong with always being root?"


Was this article helpful?

mood_bad No 4
mood Yes 31
visibility Views: 7838