1. 程式人生 > >批量添加用戶,並且第一次登陸需要輸入密碼

批量添加用戶,並且第一次登陸需要輸入密碼

Linux

if [ ! -f account.txt ]; then echo "The file do not exist!" exit 1 fi username=$(cat account.txt) for username in $username do useradd $username echo $username | passwd --stdin $username chage -d 0 $username done

用戶列表在account.txt文件裏

批量添加用戶,並且第一次登陸需要輸入密碼