Skip to content

Instantly share code, notes, and snippets.

@geunho
Last active August 24, 2016 00:19
Show Gist options
  • Save geunho/0ca9cf3dc03abef6e613e99aaf92f33d to your computer and use it in GitHub Desktop.
Save geunho/0ca9cf3dc03abef6e613e99aaf92f33d to your computer and use it in GitHub Desktop.
Ubuntu 사용자 추가 스크립트
#!/bin/bash
#
# Ubuntu
# 사용자 추가 스크립트
#################################
if [[ -z "$1" || -z "$2" ]]; then
echo "Usage: add_user [user_name] [home_dir]"
exit 0
elif [ -d "$2" ]; then
echo "home directory should be empty."
exit 0
else
USERNAME=$1
HOME_DIR=$2
useradd -m -d $HOME_DIR $USERNAME
usermod -s /bin/bash $USERNAME
if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment