|
发表于 2003-5-27 16:44:52
|
显示全部楼层
用户信息放在/etc/passwd中,密码放在/etc/shadow中,这个文件是经过系统加密的!
可以用个for循环批量建立打量的用户,但是密码是不可以批量赋予的,因为passwd命令是要直接接受来自键盘的输入.如:
root//root>cat /etc/passwd
...
txt:x:600:600::/home/a:/bin/bash
lee::500:500::/home/lee:/bin/bash
root//root>for i in auser buser cuser
> do
> mkdir /home/$i
> echo "$i::500:500::/home/$i:/bin/bash" >>/etc/passwd
> done
root//root>cat /etc/passwd
...
txt:x:600:600::/home/a:/bin/bash
lee::500:500::/home/lee:/bin/bash
auser::500:500::/home/auser:/bin/bash
buser::500:500::/home/buser:/bin/bash
cuser::500:500::/home/cuser:/bin/bash |
|