Skip to content
Snippets Groups Projects
Verified Commit 17628183 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

create_users_from_mail.sh: improve account creation script (no badname error and shorted pwd)

parent 69b4f696
Branches
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
## Session 1 ## Session 1
- add tuto on how to connect to the Rstudio server hosted at the IFB - add tuto on how to connect to the Rstudio server hosted at the IFB
## All sessions ## All sessions
- Write summary of all the commands at the end (what should have been written in the .R file during the session) - Write summary of all the commands at the end (what should have been written in the .R file during the session)
......
...@@ -7,9 +7,9 @@ USERMAILS=$@ ...@@ -7,9 +7,9 @@ USERMAILS=$@
for USERMAIL in ${USERMAILS[@]} for USERMAIL in ${USERMAILS[@]}
do do
USERNAME=$(echo ${USERMAIL} | sed -E 's/(.*)@.*/\1/') USERNAME=$(echo ${USERMAIL} | sed -E 's/(.*)@.*/\1/')
adduser ${USERNAME} --gecos 'First Last,RoomNumber,WorkPhone,HomePhone' --disabled-password adduser ${USERNAME} --gecos 'First Last,RoomNumber,WorkPhone,HomePhone' --disabled-password --force-badname > /dev/null
PASSWD=$(openssl rand -base64 10) PASSWD=$(openssl rand -base64 10)
echo "${USERNAME}:${PASSWD}" | chpasswd echo "${USERNAME}:${PASSWD}" | chpasswd > /dev/null
echo "=======================================================================" echo "======================================================================="
echo "${USERMAIL}:" echo "${USERMAIL}:"
echo "${USERNAME}" echo "${USERNAME}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment