#!/bin/bash
for i in `seq 1 3`
do
useradd userl-$i
echo "0"|passwd userl-$i --stdin 批量添加密码
done
[[email protected]alhost ~]# sh -x create_user.sh
++ seq 1 3
+ for i in ‘`seq 1 3`‘
+ useradd userl-1
+ echo 0
+ passwd userl-1 --stdin
Changing password for user coral-1.
passwd: all authentication tokens updated successfully.
+ for i in ‘`seq 1 3`‘
+ useradd userl-2
+ echo 0
+ passwd userl-2 --stdin
Changing password for user coral-2.
passwd: all authentication tokens updated successfully.
+ for i in ‘`seq 1 3`‘
+ useradd userl-3
+ echo 0
+ passwd userl-3 --stdin
Changing password for user coral-3.
passwd: all authentication tokens updated successfully.
时间: 2024-10-08 21:25:12