Last active
July 20, 2017 14:26
-
-
Save paveljurca/5323ad4cd60ca759f6485a571f72b845 to your computer and use it in GitHub Desktop.
make user
This file contains hidden or 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/sh | |
LOGIN=$0 | |
NAME=$1 | |
read PASS | |
# useradd won't create home directory from /etc/skel unless using the -m option | |
# TIP: adduser is an interactive Perl frontend around useradd | |
useradd -u $ID -g 100 -c "$NAME,,," -m $LOGIN -n | |
echo "$LOGIN:$PASS" | chpasswd | |
chmod 701 /home/$LOGIN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment