首页 > 代码库 > 批量添加用户脚本

批量添加用户脚本

#!/bin/bash

for i in `seq 1 3`

do

   useradd userl-$i

   echo "0"|passwd userl-$i --stdin 批量添加密码

done

[root@localhost ~]# 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.


本文出自 “linux运维分享” 博客,请务必保留此出处http://liangey.blog.51cto.com/9097868/1575581

批量添加用户脚本