Linux Commands Examples

A great documentation place for Linux commands


safely update /etc/passwd, /etc/shadow and /etc/group


update-passwd [options]

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


cat /etc/ > /etc/passwd
if ! update-passwd --dry-run > $tmp ; then
cat <<EOF
cat <<EOF
update-passwd has found some differences between your system accounts
and the current Debian defaults. It is advisable to allow update-passwd


update-passwd handles updates of /etc/passwd, /etc/shadow and /etc/group on running Debian systems. It compares the current files to master copies, distributed in the base-passwd package, and updates all entries in the global system range (that is, 0–99).


update-passwd follows the usual GNU command line syntax, with long options starting with two dashes (’-’).

Use FILE as the master copy of the passwd database. The default value is /usr/share/base-passwd/passwd.master.


Use FILE as the master copy of the group database. The default value is /usr/share/base-passwd/group.master.


Use FILE as the system passwd database. The default value is /etc/passwd.


Use FILE as the system shadow database. The default value is /etc/shadow.


Use FILE as the system group database. The default value is /etc/group.


Only perform sanity-checks but don’t do anything.


Give detailed information about what we are doing. A second -v gives additional detail.


Don’t do anything but only show what we would do.


Don’t attempt to lock the account database. This should only be used for debugging purposes. I repeat: do not do this unless you are really sure you need this!


Show a summary of how to use update-passwd.


Show the version number


At this moment update-passwd does not verify the shadow-file. It should check if the entries in the passwd are also in shadow and vice versa, and that passwords are not present in both files.


Wichert Akkerman <wakkerma[:at:]debian[:dot:]org>

This program was written for the Debian project, and is copyright 1999–2002 Wichert Akkerman and copyright 2002, 2003 Colin Watson. It is distributed under version 2 of the GNU General Public License.

How can this site be more helpful to YOU ?

give  feedback