Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Command to add a user with root priviledge

Posted on 2008-06-09
10
Medium Priority
?
5,898 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 80

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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
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
Course of the Month12 days, 13 hours left to enroll

971 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