图片介绍:松金洋子,著名美女模特。
正文:
当年有台ftp服务器挂了,然后要用另台拿来顶用,但是有上百个用户,一个一个创建明显不太靠谱,当初是峰哥搞的,我也不知道是咋弄的,后来才知道。开始我还以为是修改/etc/passwd文件呢。
[root@testcms sh]# cat li.sh
!/bin/bash
aa=(q w e r t)
pp=(a s d f g)
for i in ${aa[*]}
do
useradd $i
echo ${pp[*]} | passwd --stdin $i
done
[root@testcms sh]#
[root@testcms sh]# sh li.sh
li.sh: line 1: !/bin/bash: No such file or directory
Changing password for user q.
passwd: all authentication tokens updated successfully.
Changing password for user w.
passwd: all authentication tokens updated successfully.
Changing password for user e.
passwd: all authentication tokens updated successfully.
Changing password for user r.
passwd: all authentication tokens updated successfully.
Changing password for user t.
passwd: all authentication tokens updated successfully
q:x:514:514::/home/q:/bin/bash
w:x:515:515::/home/w:/bin/bash
e:x:516:516::/home/e:/bin/bash
r:x:517:517::/home/r:/bin/bash
t:x:518:518::/home/t:/bin/bash
[root@testcms sh]# su - q
[q@testcms ~]$
####################################################################################