Skip to content

Instantly share code, notes, and snippets.

@lzhbrian
Created March 6, 2020 14:10
Show Gist options
  • Save lzhbrian/7ca7de91ba2d7547f50844c243aa2567 to your computer and use it in GitHub Desktop.
Save lzhbrian/7ca7de91ba2d7547f50844c243aa2567 to your computer and use it in GitHub Desktop.
create user account in ubuntu
for i in $@
do
# create user
useradd --gid groupname --home-dir /nvme/$i --create-home --no-user-group --shell /bin/bash $i
echo $i:$i | chpasswd
# make folder a data path
mkdir /data1/$i
chown $i:groupname /data1/$i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment