1824532 Members
3662 Online
109672 Solutions
New Discussion юеВ

Adding a new user

 
P.V.Ramesh
Advisor

Adding a new user

I am using sam for creating a new user. What is equivalent command in commandline option.

If i edit /etc/passwd file and add user, is that sufficient to add a new user. If yes how do the system knows the new user is created. (I haven't edited the /etc/shadow file)

Is their any command that converts the /etc/passwd info /etc/shadow file
7 REPLIES 7
Tom Maloy
Respected Contributor

Re: Adding a new user

editing the /etc/passwd will most likely leave some loose ends - not a good idea.

You can fill in your values in this:

/usr/sbin/useradd ???u uid ???g gid ???d dir ???s /usr/bin/ksh ???f 45 ???c ???comment??? ???m login

The shell should be one listed in /etc/shells.

Tom
Carpe diem!
James R. Ferguson
Acclaimed Contributor

Re: Adding a new user

Hi:

To add new users via commandline, use the 'useradd' command. Good documentation for this can be found in the 11i man pages for 'useradd(1M)'.

You will need to convert to a trusted system to enable the shadow feature. This is easily done via SAM.

For more information, see the "Managing Systems and Workgroups: A Guide for HP-UX System Administrators" manual for more information:

http://docs.hp.com/hpux/onlinedocs/B2355-90742/B2355-90742.html

Regards!

...JRF...
P.V.Ramesh
Advisor

Re: Adding a new user

Hi TOM

I am using HP-UX 11..00. It doent have the /etc/shells file.

Hi James

I haven't received answer for my last question.i.e is their any command which converts /etc/passwd info to /etc/shadow
James R. Ferguson
Acclaimed Contributor

Re: Adding a new user

Hi (again):

I avoided the mention of 'tsconvert' and pointed you to SAM for the reasons discussed in this thread:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xeb33eea29889d611abdb0090277a778c,00.html

Regards!

...JRF...
Martin Johnson
Honored Contributor

Re: Adding a new user

Use SAM. It is quicker and it won't leave any loose ends. You can also use SAM to make your system a trusted system (i.e. use shadow password files).

HTH
Marty
Q4you
Regular Advisor

Re: Adding a new user

If you are just interested to know the "command syntax" used by sam for adding a user ?

Add one dummy user using sam the way you want it and check the samlog for actual command executed by SAM
Fred Martin_1
Valued Contributor

Re: Adding a new user

Overall, here are the basics:

1. create a passwd entry
2. create a home directory
3. modify group file to suit

And, possibly:

4. create a mail file
5. modify aliases file to suit
6. modify mail userdb to suit

Sam is probably the best way to accomplish most of it. Sam will even run a locally written script for you before and/or after creating the user, for local stuff like setting up email, vacation lists, that sort of thing. I have a script that sets up our email client for the user, for example.

But manually at a minimum:

1. vi /etc/passwd (caution on re-using user id's, etc)
2. copy /etc/skel to /home/ and verify permissions
3. create a /var/mail/ if needed
4. vi /etc/group
fmartin@applicatorssales.com