Ahmad Mahfouz

Random notes

users in shadow file explanation

this article explain the /etc/shadow

this file content the users information

example of the user data

username -> n1x
password -> $6$UoDmVdoW$tYQQm5uHgOpeEKPygIaQ1GM/0IBbdYVrLHu8ZYF5pT17D3VM.FFKa2wS8J6gqbGKC2IpgImXy7SYVJK9r/fdw.
last date password update since 1970-1-1 -> 16631

you can calculate it simply in python

minmum password age -> 7
maximum password age -> 15
warning days -> 2
inactive days -> 14
expiration date -> 16819

we can list or modify a user by a chage command
example

for setting default config for all users you can use /etc/login.defs

# Password aging controls:
#
# PASS_MAX_DAYS Maximum number of days a password may be used.
# PASS_MIN_DAYS Minimum number of days allowed between password changes.
# PASS_MIN_LEN Minimum acceptable password length.
# PASS_WARN_AGE Number of days warning given before a password expires.
#
PASS_MAX_DAYS 30
PASS_MIN_DAYS 10
PASS_MIN_LEN 10
PASS_WARN_AGE 1

Leave a Reply

Your email address will not be published. Required fields are marked *.

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.