1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#!/bin/bash
if
[ ! -d
/rhome
]
then
mkdir
-p
/rhome
fi
continue
uid=1000
for
i
in
`
seq
1 30`;
do
if
[ $i -lt 16 ]
then
useradd
-d
/rhome/user
$i -s
/bin/bash
user$i -u $(($uid+$i))
echo
"redhat|passwd user$i --stdin"
elif
[ $i -gt 15 ]
then
useradd
-d
/rhome/user
$i -s
/sbin/nologin
user$i -u $(($uid+$i))
echo
"redhat|passwd user$i --stdin"
fi
done
|
本文转自 boy461205160 51CTO博客,原文链接:http://blog.51cto.com/461205160/1747525