Created
August 30, 2023 17:26
-
-
Save ajgappmark/018b4308ec5ed43bedd48497215569a7 to your computer and use it in GitHub Desktop.
create new user with specified credentials for limited time and add him to a desired group
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
USERNAME="johndoe" | |
PASSWD="xxxxxxxx" | |
FULLNAME="John Doe" | |
sudo useradd ${USERNAME} -b /home/hackathon -m -s /bin/bash -e 2023-09-02 -c "${FULLNAME} - guest user for hackathon" && \ | |
echo $USERNAME, ${FULLNAME} " created!" | |
echo "${USERNAME}:${PASSWD}" | sudo chpasswd && \ | |
echo "password set for ${USERNAME}" | |
sudo usermod -a -G grphackt ${USERNAME} && \ | |
echo "user added to shared group" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment