?
Solved

Command to add a user with root priviledge

Posted on 2008-06-09
10
Medium Priority
?
5,894 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 128 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 124 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 124 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 35

Assisted Solution

by:Duncan Roe
Duncan Roe earned 124 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

719 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