Browse Source

Per-user password expiration parameter

The following parameters defined in /etc/login.defs can
be overridden per-user:

* PASS_MAX_DAYS
* PASS_MIN_DAYS
* PASS_WARN_DAYS
* INACTIVE

Related-Prod: PROD-18386

Change-Id: I5b182128f9dd8a043b48fb86e61febb2fd5c7e0a
pull/170/head
Dmitry Teselkin 6 years ago
parent
commit
47e41f45c8
3 changed files with 37 additions and 0 deletions
  1. +24
    -0
      README.rst
  2. +12
    -0
      linux/system/user.sls
  3. +1
    -0
      tests/pillar/system.sls

+ 24
- 0
README.rst View File

home: '/home/elizabeth' home: '/home/elizabeth'
password: "$6$nUI7QEz3$dFYjzQqK5cJ6HQ38KqG4gTWA9eJu3aKx6TRVDFh6BVJxJgFWg2akfAA7f1fCxcSUeOJ2arCO6EEI6XXnHXxG10" password: "$6$nUI7QEz3$dFYjzQqK5cJ6HQ38KqG4gTWA9eJu3aKx6TRVDFh6BVJxJgFWg2akfAA7f1fCxcSUeOJ2arCO6EEI6XXnHXxG10"


Configure password expiration parameters
----------------------------------------
The following login.defs parameters can be overridden per-user:

* PASS_MAX_DAYS
* PASS_MIN_DAYS
* PASS_WARN_DAYS
* INACTIVE

.. code-block:: yaml

linux:
system:
...
user:
jdoe:
name: 'jdoe'
enabled: true
...
maxdays: <PASS_MAX_DAYS>
mindays: <PASS_MIN_DAYS>
warndays: <PASS_WARN_DAYS>
inactdays: <INACTIVE>

Configure sudo for users and groups under ``/etc/sudoers.d/``. Configure sudo for users and groups under ``/etc/sudoers.d/``.
This ways ``linux.system.sudo`` pillar map to actual sudo attributes: This ways ``linux.system.sudo`` pillar map to actual sudo attributes:



+ 12
- 0
linux/system/user.sls View File

{%- if user.uid is defined and user.uid %} {%- if user.uid is defined and user.uid %}
- uid: {{ user.uid }} - uid: {{ user.uid }}
{%- endif %} {%- endif %}
{%- if user.maxdays is defined %}
- maxdays: {{ user.maxdays }}
{%- endif %}
{%- if user.mindays is defined %}
- mindays: {{ user.mindays }}
{%- endif %}
{%- if user.warndays is defined %}
- warndays: {{ user.warndays }}
{%- endif %}
{%- if user.inactdays is defined %}
- inactdays: {{ user.inactdays }}
{%- endif %}
- require: {{ requires|yaml }} - require: {{ requires|yaml }}


system_user_home_{{ user.home }}: system_user_home_{{ user.home }}:

+ 1
- 0
tests/pillar/system.sls View File

enabled: true enabled: true
home: /root home: /root
name: root name: root
maxdays: 365
testuser: testuser:
enabled: true enabled: true
name: testuser name: testuser

Loading…
Cancel
Save