#!/bin/bash
useradd $1
echo $2 | passwd --stdin $1
useradd $1
echo $2 | passwd --stdin $1
[root@linux249 ~]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:
/usr/bin:/usr/X11R6/bin:/root/bin
[root@linux249 ~]# mkdir bin
[root@linux249 ~]# mv userpass bin
[root@linux249 ~]# which userpass
/root/bin/userpass
[root@linux249 ~]# userpass snowman love1004
Changing password for user snowman.
passwd: all authentication tokens updated successfully.
[root@linux249 ~]# tail -n 1 /etc/{passwd,shadow}
==> /etc/passwd <==
snowman:x:501:501::/home/snowman:/bin/bash
==> /etc/shadow <==
snowman:$1$5LEDZAhK$7lWAgXpB40y1.Pd/yTVlq.:14607:0:99999:7:::
#!/bin/bash
for user in $(fmt id.txt)
do
useradd $user
echo password --stdin $user
done
for user in $(fmt id.txt)
do
useradd $user
echo password --stdin $user
done
[root@linux249 ~]# user.sh
password --stdin skman
password --stdin kiaman
password --stdin hwman
password --stdin dsman
password --stdin lgman
[root@linux249 ~]# tail -n 5 /etc/{passwd,shadow}
==> /etc/passwd <==
skman:x:502:502::/home/skman:/bin/bash
kiaman:x:503:503::/home/kiaman:/bin/bash
hwman:x:504:504::/home/hwman:/bin/bash
dsman:x:505:505::/home/dsman:/bin/bash
lgman:x:506:506::/home/lgman:/bin/bash
==> /etc/shadow <==
skman:!!:14607:0:99999:7:::
kiaman:!!:14607:0:99999:7:::
hwman:!!:14607:0:99999:7:::
dsman:!!:14607:0:99999:7:::
lgman:!!:14607:0:99999:7:::
http://jaso.co.kr
'로그 저장소 :) > 리눅스.Linux' 카테고리의 다른 글
vi editor (0) | 2010.09.05 |
---|---|
CentOS 5.5 Release (1) | 2010.06.15 |
DHCP(Dynamic Host Configuration Protocol) (0) | 2009.12.10 |
FTP 서버구축 - vsftp (0) | 2009.12.04 |
/home 이전 실습 (0) | 2009.11.20 |