Last active
May 9, 2017 20:18
-
-
Save ale10257/6d0d620700726978194355d626838658 to your computer and use it in GitHub Desktop.
bash script for create users on server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR_SITE="public_html/logs" | |
FILE=create_user | |
while read USER; do | |
DIR=/var/www/$USER | |
useradd -s /bin/bash -md $DIR -c "$USER" $USER | |
cd $DIR | |
mkdir -p $DIR_SITE | |
cp -r /root/.ssh/ ./ | |
chown -R $USER:$USER ./ | |
done < $FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment