Operating System - HP-UX
1753971 Members
8206 Online
108811 Solutions
New Discussion юеВ

Re: Useradd for creating system user

 
kumar_chandel
Occasional Contributor

Useradd for creating system user

I'm trying to create a user with root privileges. I'm trying to assign "/" as the home directory for the duplicate root user roota. Already the existing root user also has "/" as the home directoy.Is it possible to assign "/" as home directory for two users with same uid?

 

Please let me know whether the below command works or not:

 

useradd -ou 0 -g 0 -s /bin/ksh -d / roota

 

4 REPLIES 4
Hiren N Dave
Valued Contributor

Re: Useradd for creating system user

Yes, it will surely work.

I am an HP Employee

Was this post useful? - You may click the KUDOS! star to say thank you.
rariasn
Honored Contributor

Re: Useradd for creating system user

Hi:

 

Better to share the root password...

 

rgs,

Dennis Handly
Acclaimed Contributor

Re: useradd for creating system user

If you are doing something as dangerous having two root users, you might as well use vipw(1m), especially if using the same home directory.

That way you use vipw(1m) to remove that user.

James R. Ferguson
Acclaimed Contributor

Re: Useradd for creating system user


@kumar_chandel wrote:

I'm trying to create a user with root privileges.


Why?  As noted, using 'vipw' to replicate the root account as a renamed one is the easiest way.

 

*However* this is a very bad idea.  You should be using SUDO or RBAC to confer the privileges you apparently need to someone or something.  There are other ways, too, that are far less hazdardous then what you are trying to do. 

 

Audits and auditors aside, what happens one day when you or your sucessor, or even a colleage, decides to delete the account, named "kumar"?   Think what happens if I would do something like:

 

# find / -type f -user kumar -exec rm {} +

 

If my point isn't clear, would you do this?

 

# find / -type f -user 0 -exec rm {} +

 

Do you like rebuilding systems?

 

Regards!

 

...JRF...