Should I Login as Root User?

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.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.

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

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