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

Williams225
Williams225 used Ask the Experts™
on
Hello Experts,

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

Do more with

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

- use sudo for specific commands to run

http://www.gratisoft.us/sudo/sudoers.man.html

- 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
Commented:
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.

Hi,

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.

testuser ALL=(ALL) NOPASSWD: ALL

MS
Hi,

for another method to create super privileges for normal user,

Please find the below for details.

http://www.labtestproject.com/create_root_user_account

MS

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