Bash Create User Script
This is a very simple script to create users and set them up in a userdir enabled Apache environ.
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: ./mkacct.sh <username>"
exit;
else
sudo useradd -m -s '/bin/bash' $1
sudo chmod 711 "/home/$1"
sudo mkdir "/home/$1/public_html"
sudo chmod 755 "/home/$1/public_html"
sudo chown "$1.$1" /home/$1/public_html
sudo passwd $1
fi;
Print article | This entry was posted by elvis on 01/25/15 at 07:20:00 pm . Follow any responses to this post through RSS 2.0. |