Operating System - HP-UX
1821410 Members
2583 Online
109633 Solutions
New Discussion юеВ

strange problem with passwd command

 
SOLVED
Go to solution
Evelyn Daroga
Regular Advisor

strange problem with passwd command

Suddenly I am no able to execute the passwd command, as root and as several users (at least 1 user has no problem). Msg is "passwd: no such file or directory". I checked my PATH variable, and checked for the passwd file in /usr/bin. Both appear fine. I get the same message when I attempt to execute it using the full path (/usr/bin/passwd), even if I cd to /usr/bin and execute it as ./passwd. I made a copy of it in my user dir and get the same message if I attempt to execute it from there using the full path (/fh_isusers/dedarog/passwd). However, if I cd to my user dir and execute it as ./passwd, suddenly it works! Not only that, but now I can execute it as "passwd" (using the PATH var), as "/usr/bin/passwd", and as "/fh_isusers/dedarog/passwd". If I log out/in again, the problem reappears until I cd to /fh_isusers/dedarog and execute ./passwd.

Any ideas ??? Here's a "log" of what I did:

$passwd
passwd: No such file or directory

$ll /usr/bin/passwd
-r-sr-xr-x 5 root bin 49152 May 23 2001 /usr/bin/passwd

$/usr/bin/passwd
passwd: No such file or directory

$cd /usr/bin
$ll passwd
-r-sr-xr-x 5 root bin 49152 May 23 2001 passwd
$./passwd
passwd: No such file or directory

$cp -p /usr/bin/passwd /fh_isusers/dedarog/

$ll /fh_isusers/dedarog/passwd
-r-sr-xr-x 1 root bin 49152 May 23 2001 /fh_isusers/dedarog/passwd

$/fh_isusers/dedarog/passwd
passwd: No such file or directory

$cd /fh_isusers/dedarog
$ll passwd
-r-sr-xr-x 1 root bin 49152 May 23 2001 passwd
$./passwd
Changing password for root
Old password:

$/usr/bin/passwd
Changing password for root
Old password:

$passwd
Changing password for root
Old password:


3 REPLIES 3
Massimo Bianchi
Honored Contributor
Solution

Re: strange problem with passwd command

Hi,
can you post your $PATH please ?

ALso,
can you post an

ls -lart /etc/passwd

Regards,
Massimo
Rodney Hills
Honored Contributor

Re: strange problem with passwd command

Looks like it is not finding /etc/passwd. You are not in a "chroot" shell are you?

-- Rod Hills
There be dragons...
Evelyn Daroga
Regular Advisor

Re: strange problem with passwd command

Thanks to you both! I was totally thinking it wasn't finding the COMMAND, but it was actually having a problem with the /etc/passwd file. I had made some changes yesterday, and to test it out, I called it passwd.merged, and made a link for passwd pointing to passwd.merged. Just now, I removed the link and renamed passwd.merged to passwd, and it appears to work. Still doesn't explain the above bizzarre behavior, though, as to why it didn't work, then it worked in one situation, then it worked in all the others.

For Missami, here's my path:
echo $PATH
/usr/sbin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd
/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/langtools/bin:/opt/perf/bin:/opt/ignite/bin:/opt/OV/bin/OpC:/opt/imake/
bin:/opt/hpnp//bin:/opt/resmon/bin:/opt/pred/bin:/opt/omni/bin:/opt/hpnpl//bin:/usr/sbin/diag/contrib:/sbin:/home/root:/opt/perl5/bi
n

And here's what ll on /etc/passwd* showed:
cd /etc
ll passwd*
lrwx------ 1 root sys 13 Aug 11 09:19 passwd -> passwd.merged
-r--r--r-- 1 root sys 25348 Aug 12 03:04 passwd.merged


Here's what it looks like now, which seems to work just fine:
ll /etc/passwd*
-r--r--r-- 1 root sys 25348 Aug 12 03:04 /etc/passwd
-r--r--r-- 1 root sys 25348 Aug 12 03:04 /etc/passwd.merged.bk


But it is working now, so I'm happy about that. If anyone has an explanation, I'd love to hear it, but it is not necessary to spend time on this anymore. Thanks for the quick responses!