How to add a user with root privileges on Linux, Solaris...

Williams225 used Ask the Experts™
Hello Experts,

I would like to know how can I do to add a user with root privileges on different Linux & Unix distribution.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2007
you have two options:

- use sudo for specific commands to run

- when adding user to the system, use 0 as user id and add the user to the same groups user root is a member

The 2nd way is not recommended.
Julian ParkerSenior Systems Administrator
As omar said, the userid and group id for the user have to be set to 0.

However, it's really not a good idea to do this on any Linux/*nix platform and certainly not if it's a production server.

Use sudo instead.
Acronis in Gartner 2019 MQ for datacenter backup

It is an honor to be featured in Gartner 2019 Magic Quadrant for Datacenter Backup and Recovery Solutions. Gartner’s MQ sets a high standard and earning a place on their grid is a great affirmation that Acronis is delivering on our mission to protect all data, apps, and systems.


Look at using "sudo"

When using sudo, you can execute commands with root privileges. For example:

sudo ls -l /root

You ordinarily can't do that, but with "sudo" you can without the need for another root user.

This is what you will have to put in your /etc/sudoers file to make this command work correctly.



for another method to create super privileges for normal user,

Please find the below for details.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial