Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo -n "Create new group: "
- read GNAME
- while [ $(getent group $GNAME) ] do
- echo "Group already exists. Enter new group name: "
- read GNAME
- done
- sudo groupadd $GNAME
- echo "$GNAME created. Create a new user: "
- read UNAME
- while [ $(getent passwd $UNAME) ] do
- echo "User already exists. Enter a new user name: "
- read UNAME
- done
- sudo useradd -g $GNAME $UNAME
- echo "Welcome, $UNAME. Creating folder..."
- sudo mkdir /$UNAME
- echo "Done! Create a password: "
- sudo passwd $UNAME
- echo "Password set. User infomation is as follows: "
- id $UNAME
- sudo chown $UNAME:$GNAME /$UNAME
- sudo chmod 1775 /$UNAME
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement