1824977 Members
3633 Online
109678 Solutions
New Discussion юеВ

passwd

 
Thomas Kollig
Trusted Contributor

passwd

Hi!

If a user wants to change his password, he has to use "passwd username". "passwd" doesn't work, although the man pages say, it should work.
I'm running HPUX 10.20 without NIS.
What's going on there?

Thomas
10 REPLIES 10
Berlene Herren
Honored Contributor

Re: passwd

Is ypbind running anyway?

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
RikTytgat
Honored Contributor

Re: passwd

Hi,

This might have something to do with real/effective uid.

Did the user login as himself? Or did he login and used 'su - hisusername'? This does make a difference for passwd.

Hope this helps,
Rik.
Dan Hetzel
Honored Contributor

Re: passwd

Hi Thomas,

'passwd' is trying to get the user's name, if not given on the command line' with the getlogin() system call.

getlogin(), in turn, tries to get the user's name from /etc/utmp.

The issue you're facing could be due to a corrupted /etc/utmp file.

In this thread, Andreas Voss provides a program source to fix /etc/utmp - Thanks Andreas !!

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

Best regards,

Dan

Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Thomas Kollig
Trusted Contributor

Re: passwd

ypbind is not running.
The user doesn't use su.

How can I determine whether /etc/utmp is corrupted or not?
Just a remark, corrupted /etc/utmp files on several workstations, one of them is rebooted yesterday??

Thomas
Dan Hetzel
Honored Contributor

Re: passwd

Hi Thomas,

I said 'could be...' ;-)

Check with 'who' as this one uses /etc/utmp

Regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Steven Sim Kok Leong
Honored Contributor

Re: passwd

Hi,

Just a hunch. Is there any "passwd: " entry in your /etc/nsswitch.conf? If yes, what is stated?

If no, can you perform a "ll `which passwd`"?

Since the command "passwd" alone does not work, is there any error message when typed? What is the error message that you are getting?

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Thomas Kollig
Trusted Contributor

Re: passwd

Thanks so far. Here some more information.

The correct /etc/utmp files are used.
I don't have a /etc/nsswitch.conf.
Error message: "Usage: passwd [ -F file ] [ name ]".

One more detail: If I do a remote login with ssh it works.

Thomas
Thomas Kollig
Trusted Contributor

Re: passwd

If the current terminal is "console" then "passwd" doesn't work, "who -m" answers nothing. If the current terminal is something else then "passwd" works, also "who -m" gives the correct answer.

Why?
Dan Hetzel
Honored Contributor

Re: passwd

Hi,

What is the output if you're typing 'who' without argument ? With and without having someone logged in at the console. Is there any difference.

It really sounds like the /etc/utmp file is having a 'scrambled' entry for the console.

Dan

PS: If there aren't too many users logged in, you could ask everybody to log out and type 'cp /dev/null /etc/utmp' - This should fix your problem.
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Thomas Kollig
Trusted Contributor

Re: passwd

I think the problems are dtterms.
xterm: "who" and "who -m" works as it should be.
dtterm: "who" -> kollig console Feb 12 10:19
"who -m" -> (nothing)

When I set back the /etc/utmp file and login and open a dtterm, then there is only on entry in /etc/utmp, something like kollig...dtconsole...

Thomas