Solved

Command to add a user with root priviledge

Posted on 2008-06-09
10
5,882 Views
Last Modified: 2010-05-18
what command to be used to add a normal user with root priviledge

1) I want to add a user and the user should have root priviledge . how can i add ?

2) is it possible via usermod to give root acces for existing user ?
0
Comment
Question by:supportpro
10 Comments
 
LVL 77

Accepted Solution

by:
arnold earned 32 total points
ID: 21744867
Root privilege is often assigned through the UID.

What you can do is use SUDO to extend root rights to a regular user.

I.e. edit the /ets/sudoers file and add an entry for the user with ALL rights.

All the user would need to do after login, is to execute sudo bash and after entering the user's password (if prompted), the shell will have root rights.
0
 
LVL 4

Assisted Solution

by:albuitra
albuitra earned 31 total points
ID: 21744884
There is a bad practice in security.
have you try with sudo ?
http://www.gratisoft.us/sudo/
0
 
LVL 8

Assisted Solution

by:Rance_Hall
Rance_Hall earned 31 total points
ID: 21745408
If you make the user part of the a special group ( called the wheel group on many distros ) that user has the ability to use the su command to become root.

sudo is much more configurable and can allow users to only run specific commands, so sudo is the preferred way, but if you are in a hurry I just type "su -"
enter roots password at the prompt
and bingo I'm root.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 34

Assisted Solution

by:Duncan Roe
Duncan Roe earned 31 total points
ID: 21750286
Any user you care to create that has a UID of 0 will have full root privilege.
The security thing is really dependent on your environment. I've worked in environments which would never ever be connected to the Internet and where everyone knew the password to "toor". That project finished a while ago though.
0
 
LVL 1

Expert Comment

by:EmpireIron
ID: 21796590
modify /etc/password and change the uid to 0 that will give root access to that user. I do agree though that you should run visudo and add the users to the sudo list instead. Much more secure
0
 

Expert Comment

by:RapidDrinker
ID: 22022341
groupmems -a  -g wheel
0
 
LVL 8

Expert Comment

by:Rance_Hall
ID: 22440839
There were two equally valid approaches mentioned here, using su - to temporarily become root, and configuring sudo to be able to run specific commands with root privs

If it was up to me, I'd split the points between the first suggestion of each of the two types
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question