cannot change password for an ordinary user

56 views
Skip to first unread message

Anton Shterenlikht

unread,
Apr 13, 2017, 5:35:58 PM4/13/17
to freebsd-...@freebsd.org
On 11.0-RELEASE-p9, passwd command
seems to exit with no error for an ordinary user,
but the passwd is not updated, i.e. after passwd
has exited, this user can login only with the old
password, not the new.

I found this thread:
https://forums.freebsd.org/threads/49802
which suggested to use pwd_mkdb.

I decided to check first, and got:

# pwd_mkdb -C /etc/passwd
pwd_mkdb: corrupted entry
pwd_mkdb: at line #3
pwd_mkdb: /etc/passwd: Inappropriate file type or format


Should I be worried?
And how can change my ordinary user's password?


I can change the root password fine, tried and checked.

Thanks

Anton
_______________________________________________
freebsd-...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

Chuck Swiger

unread,
Apr 13, 2017, 8:01:20 PM4/13/17
to me...@bris.ac.uk, FreeBSD -
On Apr 13, 2017, at 2:35 PM, Anton Shterenlikht <me...@bris.ac.uk> wrote:
> [ ... ]
> I decided to check first, and got:
>
> # pwd_mkdb -C /etc/passwd
> pwd_mkdb: corrupted entry
> pwd_mkdb: at line #3
> pwd_mkdb: /etc/passwd: Inappropriate file type or format
>
>
> Should I be worried?

Yes. Run vipw and fix line 3.

> And how can change my ordinary user's password?
>
> I can change the root password fine, tried and checked.

root is usually the first entry; it's likely that fixing line 3 will let you change the user's password.

Regards.
--
-Chuck

Polytropon

unread,
Apr 14, 2017, 6:34:30 AM4/14/17
to me...@bris.ac.uk, freebsd-...@freebsd.org
On Thu, 13 Apr 2017 22:35:42 +0100 (BST), Anton Shterenlikht wrote:
> On 11.0-RELEASE-p9, passwd command
> seems to exit with no error for an ordinary user,
> but the passwd is not updated, i.e. after passwd
> has exited, this user can login only with the old
> password, not the new.
>
> I found this thread:
> https://forums.freebsd.org/threads/49802
> which suggested to use pwd_mkdb.
>
> I decided to check first, and got:
>
> # pwd_mkdb -C /etc/passwd
> pwd_mkdb: corrupted entry
> pwd_mkdb: at line #3
> pwd_mkdb: /etc/passwd: Inappropriate file type or format
>
>
> Should I be worried?

No, but use the correct program invocation:

# pwd_mkdb -C /etc/master.passwd

That is the _actual_ password file. The "pwd_mkdb" program will
use it to create the appropriate db files.

See "man pwd_mkdb" for details.



> And how can change my ordinary user's password?

Usually the "passwd" program is being used. Directly by the user:

% passwd

Or by root for a user:

# passwd <username>

Check "man 1 passwd" and "man chpass" for additional information.

The use of this program will cause the databases to be updated
(see above).




--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

Anton Shterenlikht

unread,
Apr 16, 2017, 3:02:59 PM4/16/17
to Polytropon, freebsd-...@freebsd.org
Thanks, that helped. Still don't know what happened and
why direct use of pwd_mkdb was needed.

Anton
Reply all
Reply to author
Forward
0 new messages