homey
02-23-2003, 01:47 PM
Hey peoples,
I want to use my script to add a bunch of users with as little input from me as possible. My script gives the user a blank password so I don't have to put in a gazillion passwords.
Can someone tell me about a script that does something like this...
If this is your first login,then make the user change password....
Also, where would that script get located?
Here is the adduser script
__________________________________________
#!/bin/bash
#
MAX=5000
for ((n=1; n <=MAX ; n++))
do
##
GROUP=500 # Default Group
#
# Ensure that root is running the script.
##
WHOAMI=`/usr/bin/whoami`
if [ $WHOAMI != "root" ]; then
echo "You must be root to add news users!"
exit 1
fi
##
# Ask for username.
##
echo ""
echo -n "Username: "
read USERNAME
#
echo "Adding user: $USERNAME."
#
adduser $USERNAME -g$GROUP
passwd -f -u $USERNAME
#
done
#
# End
I want to use my script to add a bunch of users with as little input from me as possible. My script gives the user a blank password so I don't have to put in a gazillion passwords.
Can someone tell me about a script that does something like this...
If this is your first login,then make the user change password....
Also, where would that script get located?
Here is the adduser script
__________________________________________
#!/bin/bash
#
MAX=5000
for ((n=1; n <=MAX ; n++))
do
##
GROUP=500 # Default Group
#
# Ensure that root is running the script.
##
WHOAMI=`/usr/bin/whoami`
if [ $WHOAMI != "root" ]; then
echo "You must be root to add news users!"
exit 1
fi
##
# Ask for username.
##
echo ""
echo -n "Username: "
read USERNAME
#
echo "Adding user: $USERNAME."
#
adduser $USERNAME -g$GROUP
passwd -f -u $USERNAME
#
done
#
# End