Solved

Command to add a user with root priviledge

Posted on 2008-06-09
10
5,891 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 79

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
PowerShell Core for Advanced Linux Administrators

Understand advanced principals around Powershell Core with a focus on the Linux Administrator.  This course covers how to administer numerous environments across multiple platforms including Linux, Azure, AWS, and Google Cloud from a single shell instance.

 
LVL 35

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

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

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

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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

635 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