2021-11-08 21:58:57
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2021/11/04 10:58:16 by gbaconni #+# #+# #
|
||||
# Updated: 2021/11/08 09:42:55 by gbaconni ### ########.fr #
|
||||
# Updated: 2021/11/08 21:58:48 by gbaconni ### lausanne.ch #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
@@ -54,8 +54,9 @@ ft_policy ()
|
||||
{
|
||||
user=${1-marvin}
|
||||
sed -i'.orig' -r 's/^#?(PASS_MAX_DAYS).*/\1\t30/; s/^#?(PASS_MIN_DAYS).*/\1\t2/; s/^#?(PASS_WARN_AGE).*/\1\t7/; s/^#?(PASS_MIN_LEN).*/\1\t10/;' /etc/login.defs
|
||||
sed -i'.orig' -r 's/^[# ]*(minlen =)/\1 10/; s/^[# ]*([ud]credit =)/\1 -1/; s/^[# ]*(maxrepeat =)/\1 3/; s/^[# ]*(usercheck =)/\1 1/; s/^[# ]*(difok =)/\1 7/;' /etc/security/pwquality.conf
|
||||
sed -i'.orig' -r 's/^[# ]*(minlen =).*/\1 10/; s/^[# ]*([ud]credit =).*/\1 -1/; s/^[# ]*(maxrepeat =).*/\1 3/; s/^[# ]*(usercheck =).*/\1 1/; s/^[# ]*(enforcing =).*/\1 1/; s/^[# ]*(difok =).*/\1 7/; s/^[# ]*(enforce_for_root)/\1/; s/^[# ]*(local_users_only)/\1/;' /etc/security/pwquality.conf
|
||||
chage -M 30 -m 2 -W 7 ${user}
|
||||
chage -M 30 -m 2 -W 7 root
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user