In addition to the files : /etc/group
, /etc/passwd
and /etc/shadow
, I could see three files in my linux machine.
/etc/group-
/etc/passwd-
/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?
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.
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.
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 .
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With