Use of /etc/passwd-, /etc/shadow-, /etc/group-

nitin_cherian picture nitin_cherian · Oct 24, 2011 · Viewed 20.7k times · Source

In addition to the files : /etc/group, /etc/passwd and /etc/shadow, I could see three files in my linux machine.

  1. /etc/group-
  2. /etc/passwd-
  3. /etc/shadow-

I cannot see these files in my root filesystem. But when I try to add one user using useradd command, these files seem to get generated.

So i would like to know when exactly is these files created and what is the use of these files?

Answer

Petr picture Petr · Oct 24, 2011

These are backups of previous versions.

Manual pages show these files and states:

/etc/passwd-

Backup file for /etc/passwd.

/etc/shadow-

Backup file for /etc/shadow.

Note that this file is used by the tools of the shadow toolsuite, but not by all user and password management tools.

See http://manpages.ubuntu.com/manpages/oneiric/man5/shadow.5.html and http://manpages.ubuntu.com/manpages/oneiric/man5/passwd.5.html