Before getting into how to change a user’s password on FreeBSD, let’s have a quick revision on how that can be done on a Linux system.
As a user we can change the password by typing:
$ passwd
Changing password for user kenno.
Changing password for kenno.
Current password:
...
Or with a root account, we can change/set the password for another user:
# passwd kenno
Changing password for user kenno.
New password:
...
How about a FreeBSD? It should be the same way as how it’s done on Linux right? Right? Well, not quite.
On a FreeBSD system, in addition to run the passwd command, we also need to generate the password databases to be “in sync” with the plain text files.
# pwd_mkdb /etc/master.passwd
You can learn more about both passwd and pwd_mkdb, by running:
$ man passwd
$ man pwd_mkdb