I need to have the ability to create user accounts on my Linux (Fedora 10) and automatically assign a password via a bash script(or otherwise, if need be).
It\'s eas
usage: ./my_add_user.sh USER PASSWD
./my_add_user.sh USER PASSWD
code:
#!/bin/bash # my_add_user.sh if [ "$#" -lt 2 ] then echo "$0 username passwd" exit fi user=$1 passwd=$2 useradd $user -d /data/home/$user -m ; echo $passwd | passwd $user --stdin;