Last active
October 11, 2017 20:04
-
-
Save tonejito/279f7235d4c1865c23602325063d4f89 to your computer and use it in GitHub Desktop.
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 | |
| PREFIX=user | |
| for NUMBER in {00..09} | |
| do | |
| NAME="${PREFIX}${NUMBER}" | |
| # Genera la sal aleatoriamente desde /dev/urandom | |
| SALT=$(dd if=/dev/urandom bs=1 count=6 2>/dev/null | base64) | |
| PW="`mkpasswd -m sha-256 'password'${NUMBER} ${SALT}`" | |
| useradd \ | |
| --password "${PW}" \ | |
| --create-home \ | |
| --home-dir=/home/$NAME \ | |
| --shell=/bin/bash \ | |
| --gid users \ | |
| $NAME | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment