-
-
Save ljamel/9d0784d214f0c11b886b5de480d62619 to your computer and use it in GitHub Desktop.
Deploy multi users in linux serveur
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/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