Adding users from a file-enforce to change their existing password on first login with shell script.

Adding users from a file-enforce to change their existing password on first login with shell script.

Chaxiong Yukonhiatou

55 лет назад

37 Просмотров

#ShellScript
$Changepassword
$force
$Linux
-----------------------------------------------------------------
f='users.txt'
p='admin@123'

for i in `cat $f`
do
#add users
useradd -m -d /home/myscripts/accounts/$i $i -s /bin/bash
#set password for users
echo "$i:$p" | chpasswd
#force users to change password
chage -d 0 $i
done
echo "Done!"
Ссылки и html тэги не поддерживаются


Комментарии: