Skip to content

Instantly share code, notes, and snippets.

@ljamel
Created November 24, 2022 22:34
Show Gist options
  • Save ljamel/9d0784d214f0c11b886b5de480d62619 to your computer and use it in GitHub Desktop.
Save ljamel/9d0784d214f0c11b886b5de480d62619 to your computer and use it in GitHub Desktop.
Deploy multi users in linux serveur
#!/bin/bash
declare -a tableau=( "martin" "john" "connor" )
i=${!tableau[@]}
for i in $i
do
#sudo useradd ${tableau[$i]}
#sudo passwd -f -u ${tableau[$i]}
echo "bonjour ${tableau[$i]}"
mdp=$(openssl rand -base64 9)
echo -e "$mdp" | passwd ${tableau[$i]}
#sudo useradd ${tableau[$i]} -s /bin/bash -p '${tableau[$i]}'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment