Skip to content

Instantly share code, notes, and snippets.

@ale10257
Last active May 9, 2017 20:18
Show Gist options
  • Save ale10257/6d0d620700726978194355d626838658 to your computer and use it in GitHub Desktop.
Save ale10257/6d0d620700726978194355d626838658 to your computer and use it in GitHub Desktop.
bash script for create users on server
#!/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