Thứ Ba, 8 tháng 3, 2016

[IBM AIX] - Create many users follow [PCIDSS - User Policy] in a script



#!/bin/bash
x() {
LIST=
SET_A=
for i in "$@"
do
        if [ "$i" = "admin=true" ]
        then
                SET_A="-a"
                continue
        elif [ "$i" = "admin=false" ]
        then
                continue
        fi
        LIST="$LIST \"$i\""
done
eval mkuser $SET_A $LIST
}
for tpbuser in u_xxx u_yyy u_zzz
do
x admin='false' pgrp='staff' rlogin='true' loginretries='5' pwdwarntime='7' histsize='4' histexpire='0' maxage='13' minage='4' minlen='7' minalpha='1' minother='1' maxrepeats='5' mindiff='1' $tpbuser;
echo $tpbuser:Callme#1234 | chpasswd;
pwdadm -c $tpbuser;
done;

Không có nhận xét nào: