Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 02-18-2007, 08:40 PM   #1
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Fedora (Desktop), CentOS (Server), Knoppix (Diags)
Posts: 934

Rep: Reputation: 38
Proper way to set user as root access?

I would like to be able to set a user account to have the same privelages as root. I previously tried to set the GID in /etc/passwd to 0 (like root) for that user, but that didn't seem to work. Is there something else I need to do?
Old 02-18-2007, 11:24 PM   #2
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 448

Rep: Reputation: 34
You can't set a user up identical to root - that would be pretty redundant as far as security is concerned.

Why do you need to have a user setup to emulate root?

It would be better to leave the user as a "normal" user, and setup sudo on your box. I usually add my "admin" users to the 'root' group, then add an entry in to sudoer's file that allow member of the root group to execute anything as root. Then all I have to do is just pre-pend "sudo" to all my commands that need root. It will effectively increase the verbosity of log detail so you can add accountability to root actions to a particular user if they do stuff something.
Old 02-19-2007, 02:39 PM   #3
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,103

Rep: Reputation: 4381Reputation: 4381Reputation: 4381Reputation: 4381Reputation: 4381Reputation: 4381Reputation: 4381Reputation: 4381Reputation: 4381Reputation: 4381Reputation: 4381
You can set up a user as a group-0, which will have root privileges, but that's a VERY bad idea. I concur with the previous poster; install and set up SUDO. If you ABSOLUTELY need it, a user can run a SUDO shell, effectively giving them root-rights.

Root should be used sparingly, and with great caution.
Old 02-19-2007, 05:30 PM   #4
Registered: Oct 2003
Location: Sydney, Australia.
Distribution: PCLinuxOS 2010.12, Debian Lenny
Posts: 396

Rep: Reputation: 38
A root shell using sudo can be had with:

sudo -i
Just thought I'd add my 2 bits.
Old 02-19-2007, 08:03 PM   #5
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Fedora (Desktop), CentOS (Server), Knoppix (Diags)
Posts: 934

Original Poster
Rep: Reputation: 38
Ok, I'll look into Sudo. Never done it. Thank you all for providing me with the info ... and for not chewing me a new one for asking the question ...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I set environmental variables of vi editor in ROOT user? sbnice Linux - General 2 12-18-2006 10:24 PM
1:root vncserver: The USER environment variable is not set. Niceman2005 Linux - Software 1 05-24-2006 10:13 PM
set up access to host a website per user bjs Linux - Newbie 1 01-10-2006 11:08 AM
set up root access [DvS]deadman Linux - Networking 4 04-26-2004 12:25 PM
How to set tcsh prompt: # for root and % for user? robson Linux - Newbie 1 10-12-2003 03:13 PM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration