Solved

Command to add a user with root priviledge

Posted on 2008-06-09
10
5,872 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 76

Accepted Solution

by:
arnold earned 32 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 34

Assisted Solution

by:Duncan Roe
Duncan Roe earned 31 total points
Comment Utility
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
Comment Utility
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
Comment Utility
groupmems -a  -g wheel
0
 
LVL 8

Expert Comment

by:Rance_Hall
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now