Common Linux Commands – Part 2

Common Linux Commands – Part 2

2. Explanation of File Contents

/etc/passwd # Directory storing user filesroot:x:0:0:root:/root:/bin/bashgdm:x:42:42::/var/lib/gdm:/sbin/nologin# Explanation:1 root=Username2 x=Placeholder for user password stored in /etc/shadow file3 0=UID User account, 0 is root, 1-499(999) are system accounts, 500(1000)-65535 are regular accounts4 0=GID User group5 root=Account description for notes6 /root=User home directory7 /bin/bash=Default shell script for remote login, /bin/nologin=Account that cannot log in by default/etc/shadow # Directory storing passwordsroot:$6$DUiJ86eiVo9kFVlgnYS1:17631:0:99999:7:::daemon:*:17557:0:99999:7:10:17560:# Explanation:1 root=Username2 $6$DUiJ86eiVo9kFVlgnYS1=User password encryption field3 17631=Date when the password was last used, calculated from 1970-1-1 4 0=Minimum days before the password can be changed, 0 means it can be changed anytime5 99999=Days after which the password must be changed, 99999 means it can remain unchanged indefinitely6 7=Days before password change that the user is reminded, 7 means a reminder 7 days prior7 10=Password will expire 10 days after not being changed, if 0, the password expires immediately8 17560=Password will automatically expire regardless of any conditions9 Reserved field, currently has no meaning

Leave a Comment