Operating System - HP-UX
1836441 Members
3384 Online
110100 Solutions
New Discussion

Re: user with root privelege

 
SOLVED
Go to solution
Jason Miñoza
Advisor

user with root privelege

a simple one, how do make a user with root privelege :)
friends get u places
7 REPLIES 7
Sridhar Bhaskarla
Honored Contributor

Re: user with root privelege

Simple - Create a user with uid "0".

But this is a security violation. It's better to use tools like sudo

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sanjay_6
Honored Contributor
Solution

Re: user with root privelege

Use this command,

# useradd -u 0 -o -g root -d new_user_home_directory -s /sbin/sh new_user_name
# passwd new_user_name

This is a security violation but is necessary as a backout procedure if the root password is somehow lost or forgotten.


MANOJ SRIVASTAVA
Honored Contributor

Re: user with root privelege

Hi Jason

Simple way is to create any user and the edit /etc/passwd file and change the 3rd and 4th field to 0 and 3 . You are all set to go.


Manoj Srivastava
Sachin Patel
Honored Contributor

Re: user with root privelege

Hi jason,
Simple: use uid=0 for anyuser and it is root.
But better way to do is use third party software like sudo, super. They are easy to setup.

Sachin
Is photography a hobby or another way to spend $
Deshpande Prashant
Honored Contributor

Re: user with root privelege

Hi
I will prefer using software utilities like "SUDO" over creating user with uid 0.

If you are looking for only some commands/scripts to be used by normal user that need root previlages (eg. useradd/ userdel), you may consider using restricted sam for user. You can even build the custom applications in it.
Thanks.
Prashant.
Take it as it comes.
Rita C Workman
Honored Contributor

Re: user with root privelege

Well, there are a few ways to do this:

1. You could give him the root password (not the best option obviously)
2. You could set up sudo (Free software..but there are security holes here)
3. You could set up restricted SAM and give them only the options you want them to have (recommeneded and easy)
4. You could use SCM and define what privileges you want them to have.

*** Chris Wong wrote a book called 11i Security. It covers these types of security issues, and is pretty good.....and don't let the title fool you, the book covers 10.2 thru 11i.

Just a suggestion,
Rita
Joseph C. Denman
Honored Contributor

Re: user with root privelege

As stated above, you should just give him the root password. However, if your doing this to have a backdoor in the system just in case you forget root password or something like that, be careful. If you use SAM to remove the user, at a future date, do not forget that the user is a root user. If you select yes to remove all file of the user, your system will be gone. SAM uses the UID to remove the users files. Since this user will have a UID of 0, all files owned by root will be removed.

...jcd...
If I had only read the instructions first??