LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-05-2010, 12:02 AM   #1
nishanthame
LQ Newbie
 
Registered: Mar 2010
Location: Colombo
Distribution: Ubuntu and Cent OS
Posts: 9

Rep: Reputation: 2
Create user with root privileges..


Hi all

I want to create a user who has all the privileges that root user has.I know how to create a user but i don't know how to grant root privileges to him. Can some give me some help ...?

Nishantha
 
Old 07-05-2010, 01:36 AM   #2
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
I believe what you want is "sudo". It allows you to give users certain permissions that normally only root would have. I wouln't give the user(s) all permissions, though, just to be on the safe side.

When a user wants to execute a command with root priveleges, they have to prefix it with "sudo" (i.e. sudo <command here>), then they must confirm it with their user password.

Last edited by MrCode; 07-05-2010 at 01:38 AM.
 
Old 07-05-2010, 03:51 AM   #3
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
you can give administrative privileges to users, that is generally under the privileges tab if you are using the GUI to add the users.
Its safer to let the users do "sudo" to become root only when required.
 
Old 07-05-2010, 04:34 AM   #4
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
you can give administrative privileges to users, that is generally under the privileges tab if you are using the GUI to add the users.
Yes, but you never did mention what distro you're using. Not all distros provide a GUI for setting user privileges. For example, I'm on Arch, and it (by default) has no method of adding/removing/modifying users from the GUI.

Last edited by MrCode; 07-05-2010 at 04:36 AM.
 
Old 07-05-2010, 04:51 AM   #5
nishanthame
LQ Newbie
 
Registered: Mar 2010
Location: Colombo
Distribution: Ubuntu and Cent OS
Posts: 9

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by MrCode View Post
Yes, but you never did mention what distro you're using. Not all distros provide a GUI for setting user privileges. For example, I'm on Arch, and it (by default) has no method of adding/removing/modifying users from the GUI.
My distro is Cent OS and I know about sudo. I just want to create user with root privileges..
 
Old 07-05-2010, 07:39 AM   #6
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Linux Mint, Ubuntu
Posts: 1,514

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
Quote:
Originally Posted by nishanthame View Post
My distro is Cent OS and I know about sudo. I just want to create user with root privileges..
Create another user with uid=0 and gid=0?
 
Old 07-05-2010, 07:51 AM   #7
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
Quote:
Originally Posted by nishanthame View Post
My distro is Cent OS and I know about sudo. I just want to create user with root privileges..

You really don't want to do this. Seriously. There is a VERY good reason to keep the administrative functions separated from the general user population. It is called security. I seriously doubt that there are any situations where it couldn't be handled more properly by sudo.
 
Old 07-05-2010, 11:19 PM   #8
nishanthame
LQ Newbie
 
Registered: Mar 2010
Location: Colombo
Distribution: Ubuntu and Cent OS
Posts: 9

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by Hangdog42 View Post
You really don't want to do this. Seriously. There is a VERY good reason to keep the administrative functions separated from the general user population. It is called security. I seriously doubt that there are any situations where it couldn't be handled more properly by sudo.

It can be done using the useradd -g root <username> command
 
Old 07-05-2010, 11:35 PM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by nishanthame View Post
It can be done using the useradd -g root <username> command
That would not "create a user who has all the privileges that root user has".
 
Old 07-06-2010, 07:52 AM   #10
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
Quote:
Originally Posted by nishanthame View Post
It can be done using the useradd -g root <username> command

You're missing the point of what I said. I didn't say it couldn't be done, I said that it shouldn't be done. Linux allows you to do a lot of things that are, in practice, really bad ideas. This is one of them.

If instead of asking how to create a different root user, you outlined the problem that you want solved, we could probably get you a much better answer that doesn't involve compromising security.
 
Old 07-06-2010, 08:21 AM   #11
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,973

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Quote:
Originally Posted by nishanthame View Post
I want to create a user who has all the privileges that root user has.I know how to create a user but i don't know how to grant root privileges to him. Can some give me some help ...?
Why do you need to do this? Is there some functionality that you're chasing?
 
  


Reply


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 to create user similar to root privileges salimshahzad Linux - Newbie 13 02-21-2010 08:29 PM
What is the command to create a new user with certain privileges? bleevu Linux - Security 3 06-27-2008 06:16 AM
Create new account with root privileges? prasannasellam Linux - Newbie 2 01-21-2008 02:34 AM
Create Profiles with Root Privileges dumbsheep Linux - Newbie 7 01-11-2005 02:46 PM
How can I create a user with the same privileges as the root ? Menestrel Linux - Newbie 3 11-19-2003 10:38 PM


All times are GMT -5. The time now is 12:46 PM.

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