Should I Login as Root User?

August 1, 2014 1.2k views

My question is do I setup a User account and add it to the sudoers list or can I continue to login as root?

To give you some background I still consider myself a novice Linux user. My main function is as a front-end web developer. Throughout my Desktop Linux-life I've seen countless articles that state not to login as the root user -- ever! Instead setup an account and run sudo commands for the heavy stuff.

With my new-found droplet from Digital Ocean it's thrown me for a mini loop. I immediately gain root access with no users on the system. So far I've performed "YUM install" commands without a care in the world. I've moved tarballs into the /usr/src directory then "config-make-makeInstall." This power is blissful, but my conscious still tugs at me saying I should create a User. Thanks.

3 Answers

Yes, it is a good idea to create a new user, and use sudo for things you need to do as root.

The hundreds of thousands of articles telling you not to use root user are correct.

It is better to set up a user account for normal usage and disable the root account (disable login).
Then sudo to do administrative work.

This can prevent mistyped commands do damage to system, though it is rare.
If it is a multiple account system, you can assign which user can have sudo right or even prevent some user with sudo right from running certain command like sudo su.

Since sudo will log all the command into /var/log/auth.log (ubuntu), you can review it latter.
Enabling log_output in sudoers config, you can use sudoreplay for review.

Have another answer? Share your knowledge.