add password-generator with nice function lul

This commit is contained in:
2021-04-08 01:12:15 +02:00
parent 20e79c889d
commit d0ddc1461c
2 changed files with 40 additions and 4 deletions

View File

@@ -76,4 +76,12 @@ Version: 3.9.2
## (L)inux(A)pache(M)ysql(P)HP
![](https://img.shields.io/badge/Debian%2010%20-%20error%20-%20red) ![](https://img.shields.io/badge/Debian%209%20-%20error%20-%20red) ![](https://img.shields.io/badge/Ubuntu%2018.04%20-error-%20red)<br>
<code>bash <(wget -O - 'https://git.io/xxxxxx')</code>
<code>bash <(wget -O - 'https://git.io/xxxxxx')</code>
----
## Password-Generator
![](https://img.shields.io/badge/Debian%2010-work!-green) ![](https://img.shields.io/badge/Debian%209-work!-green) ![](https://img.shields.io/badge/Ubuntu%2020.04-work!-green) ![](https://img.shields.io/badge/Ubuntu%2018.04-work!-green)<br>
<code>bash <(wget -O - 'https://git.io/JYA1y')</code>

View File

@@ -1,5 +1,33 @@
#!/usr/bin/env sh
echo 'Generating 32-character passwords'
for ((n=0;n<100;n++))
GEN_PW_SSH=$(for ((n=0;n<1;n++))
do dd if=/dev/urandom count=1 2> /dev/null | uuencode -m - | sed -ne 2p | cut -c-32
done)
GEN_PW_SSH_KEY=$(for ((n=0;n<1;n++))
do dd if=/dev/urandom count=1 2> /dev/null | uuencode -m - | sed -ne 2p | cut -c-128
done
done)
GEN_PW_FTP=$(for ((n=0;n<1;n++))
do dd if=/dev/urandom count=1 2> /dev/null | uuencode -m - | sed -ne 2p | cut -c-32
done)
GEN_PW_MYSQL=$(for ((n=0;n<1;n++))
do dd if=/dev/urandom count=1 2> /dev/null | uuencode -m - | sed -ne 2p | cut -c-32
done)
GEN_PW_MAIL=$(for ((n=0;n<1;n++))
do dd if=/dev/urandom count=1 2> /dev/null | uuencode -m - | sed -ne 2p | cut -c-32
done)
if [[ -f $(which uuencode 2>/dev/null) ]]
then
echo "SSH-Password: $GEN_PW_SSH"
echo "SSH-KEY-Password: $GEN_PW_SSH_KEY"
echo "FTP User Password: $GEN_PW_FTP"
echo "MYSQL User Password: $GEN_PW_MYSQL"
echo "e-Mail User Password: $GEN_PW_MAIL"
else
apt update && apt install sharutils
echo "SSH-Password: $GEN_PW_SSH"
echo "SSH-KEY-Password: $GEN_PW_SSH_KEY"
echo "FTP User Password: $GEN_PW_FTP"
echo "MYSQL User Password: $GEN_PW_MYSQL"
echo "e-Mail User Password: $GEN_PW_MAIL"
fi