Operating System - HP-UX
1752279 Members
4406 Online
108786 Solutions
New Discussion юеВ

Re: creating users using VIPW.

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

creating users using VIPW.

Hi

how to create / handle the users using vipw.

11 REPLIES 11
Suraj K Sankari
Honored Contributor

Re: creating users using VIPW.

hi,

vipw edits the password file while setting the appropriate locks, and does any necessary processing after
the password file is unlocked. If the password file is already being edited, you will be told to try again later.
The vi editor is used unless the environment variable EDITOR indicates an alternate editor. vipw
performs a number of consistency checks on the password entry for root, and does not allow a password
file with an incorrectly formatted root entry to be installed.

Suraj
senthil_kumar_1
Super Advisor

Re: creating users using VIPW.

is vipw is a editor like vim in linux?

can we use vipw to edit any file?

pls explain me how to use vipw to addusers in /etc/passwd.
Ganesan R
Honored Contributor
Solution

Re: creating users using VIPW.

Hi Senthilkumar,

VIPW is noting but edit the /etc/passwd file using vi.
The advantage of using vipw is that only one person can edit at one time. So that it will avoid file corruption.

Using vipw you can directly edit uid/gid/comment/shell/login directory instead of using usermod.

You can also create a new user by putting new entry in /etc/passwd. But note that you need to change the password using passwd command. Also you need to manually copy the startup files from skelton directory.
Best wishes,

Ganesh.
Ganesan R
Honored Contributor

Re: creating users using VIPW.

>>can we use vipw to edit any file?<<

No. You can't edit any other file.

>>pls explain me how to use vipw to addusers in /etc/passwd.<<

Just add another line like any other user in /etc/passwd.

See man vipw for more details.

Best wishes,

Ganesh.
senthil_kumar_1
Super Advisor

Re: creating users using VIPW.

can we use vi to edit /etc/passwd?

but if we use vipw to edit /etc/passwd then no one can edit that file "/etc/passwed" at same time.
Dennis Handly
Acclaimed Contributor

Re: creating users using VIPW.

>can we use vi to edit /etc/passwd?

Why? vipw does that for you.

>but if we use vipw to edit /etc/passwd then no one can edit that file "/etc/passwed" at same time.

That's correct, only one use can be modifying /etc/password at a time.
Dennis Handly
Acclaimed Contributor

Re: creating users using VIPW.

That's:
That's correct, only one user can be modifying /etc/passwd at a time. Other users can still read it.
Ashish Parashar
Frequent Advisor

Re: creating users using VIPW.

Hello Senthil

vipw inshore that the modification is doing by only one user ├в ┬ж

Well you can copy one of the string from your password file and edit according to your user ,then edit the password file with vipw├в ┬ж

If your system is trusted the execute pwconv to update tcb file as well


Thanks & Regards

Ashish Parashar
System Administrator
Suraj K Sankari
Honored Contributor

Re: creating users using VIPW.

Hi Senthil,

Yes you can used vi to edit the /etc/passwd file but in my concerned it better to use vipw instead of vi.

To create new account using vi

If you are using vi to create a account then you need to do this steps
1.create a home directory for user i.e. newuser
2.copy all file from /etc/skel into /home/newuser
3. open /etc/passwd file into vi
4.copy paste last line
5.edit username:uid:gid:comments:homedirectory:shell
6.save the file check with pwck command
7.change the passwd for newuser
8.passwd newuser

HP Guru's please correct me if I miss any step's

Suraj