Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #For add username&passwd
- #History
- #2010/07/04 Jacques
- PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
- export PATH
- [ $USER != 'root' ] &&exit 1
- for i in `cat account_passwd.txt`
- do
- USER=`echo $i |cut -d':' -f 1`
- PASS=`echo $i |cut -d':' -f 2`
- if id $USER &>/dev/null
- then
- echo "The user $USER is exitst!"
- else
- useradd $USER -g webadmin
- echo $PASS| passwd --stdin $USER
- echo "username is $USER, and password is $PASS"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement