Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of /etc/passwd-, /etc/shadow-, /etc/group- [closed]

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?

like image 721
nitin_cherian Avatar asked Oct 24 '11 08:10

nitin_cherian


People also ask

What is the use of ETC passwd and etc shadow file?

Most modern Linux operating systems use a combination of /etc/passwd and /etc/shadow to store user account information including password hashes in /etc/shadow . By default, /etc/shadow is only readable by the root user.

What is ETC shadow vs etc passwd?

The major difference is that they contain different pieces of data. passwd contains the users' public information (UID, full name, home directory), while shadow contains the hashed password and the password expiry data.

What are the owner group and permissions of etc passwd and etc shadow?

The most commonly used and standard scheme is to perform authentication against the /etc/passwd and /etc/shadow files. /etc/passwd is a plain text-based database that contains information for all user accounts on the system. It is owned by root and has 644 permissions .


1 Answers

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

like image 59
Petr Avatar answered Sep 24 '22 13:09

Petr