Sometimes you need to generate a password and the /etc/shadow style hash. This container does that.
979
$ cat Dockerfile
FROM python:3.6
CMD PASS=`dd if=/dev/random bs=48k count=1 2>/dev/null | sha512sum | awk '{print $1}'`; \
echo $PASS; \
echo $PASS | python3 -c "import crypt;print(crypt.crypt(input(''), crypt.mksalt(crypt.METHOD_SHA512)))"
It will echo a secure password, and then the SHA512 salted hash to add to /etc/shadow. This is useful for when you need to add a hashed password somewhere. Sample run:
$ docker run cdegroot/passgen
03c15b86ff047ab08f6272570a20ee5d6ed83867bfbbb15b00e7ccc2aa511c9d02a7c4d4004275dc46bba4cd12bdea1fa58c0a6319044c87866a2de308f8474e
$6$p3/hVzaFTctti4Cu$CoTSzr990zJI7JUx1B6wMSMOisVaCBVFBEk6dtA7EoUqs81zvY1ubEWo/WP2mzzWFdAY73hC8XUE9gIONBzZO/
The first string 03c15... goes into your LastPass, the second one into /etc/shadow.
Content type
Image
Digest
Size
258.8 MB
Last updated
over 8 years ago
docker pull cdegroot/passgen