1819866 Members
2747 Online
109607 Solutions
New Discussion юеВ

problems with vipw

 
SOLVED
Go to solution
hpux-fan
New Member

problems with vipw

hi there,
when i try to modify my /etc/passwd file using vipw i keep getting following message:

vipw: you mangled the temp file, /etc/passwd unchanged

when i try to modify root's start-up program (/data/prog/rootmenu) using sam i receive this:

Failed to modify user "root".
An invalid argument was supplied to an option in the command "usr/sam/lbin/usermod.sam".

hope someone of you experts out there can help me solve this problems. it's hp-ux 10.20 running on an hp9000 model 817s.
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: problems with vipw

Hi:

Unless you want to create an un-startable system, don't modify the 'root' account's initial program in '/etc/passwd'. You *must* use '/sbin/sh'. This is the statically linked Posix shell available when nothing but the root filesystem is mounted.

The 'vipw' utility is being helpful and is alerting you to that fact that you are attempting to create chaos.

Regards!

...JRF...
hpux-fan
New Member

Re: problems with vipw

hi JRF
okay, i agree it's not clever to abuse root account for this. i've tried to select another start-up file for another (low-priority) user, but it won't work. i just want to achive following: when a user logs on s/he gets a menu to see instead of a shell. i don't know what's chaos with this? do you have another (more elegant) idea how to realize this?

kind regards
hpux-fan
James R. Ferguson
Acclaimed Contributor
Solution

Re: problems with vipw

Hi (again):

OK, use a non-root account and in lieu of the shell program in '/etc/passwd' [the last field], substitute the absolute path and name of your menu script. You can use 'vipw' to make this change. When you exit your menu, your user will be logged-off.

Regards!

...JRF...
hpux-fan
New Member

Re: problems with vipw

i just followed your advice and then i was confrontated with a message saying:

lckpwdf: Permission denied
vipw: Cannot obtain lock for /etc/.pwd.lock

finally, Alex' advice helped me through this.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=84458
Prashanth.D.S
Honored Contributor

Re: problems with vipw

Hi,

Modifying the root shell using vipw is causing problems.
Try the following:

1. /sbin/sh
Result: Can vi old /etc/passwd file and quit out.

2. /sbin/ksh
Result: Cannot vi new /etc/passwd file and quit out

3. vi /etc/passwd and change the root shell to /sbin/sh

4. save file

5. vipw and quit out
Result: This was successful.

For further information, see the vipw(1m) command man page

Best Regards,
Prashanth
hpux-fan
New Member

Re: problems with vipw

now it works!