From 1ae2c4c40bf422ab6537d6f92f6f2f582cf420e0 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sat, 17 Aug 2024 22:43:57 +0300 Subject: [PATCH] addded bash pwd generator --- content/posts/2024/bash/password-generator.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 content/posts/2024/bash/password-generator.md diff --git a/content/posts/2024/bash/password-generator.md b/content/posts/2024/bash/password-generator.md new file mode 100644 index 0000000..ff65e0b --- /dev/null +++ b/content/posts/2024/bash/password-generator.md @@ -0,0 +1,57 @@ +--- +title: "🔑 Генератор паролей в виде однострочника на Bash" +date: 2024-08-17T22:33:12+03:00 +draft: false +tags: [linux, tips, security] +--- + +Пост [Cyrus](https://stackoverflow.com/a/44377013) на **SoF**. + +Команда: + +```sh +tr -dc 'A-Za-z0-9!?%=' < /dev/urandom | head -c 20 +``` + +Выхлоп: + +```text +7sixuvfqbFRAj4g=3v7Y +``` + + + +## Другие варианты + +### OpenSSL + +Команда: + +```sh +openssl rand -base64 20 +``` + +Выхлоп: + +```text +c+EtG4VK/0JLR6tWrneAlP4bHmQ= +``` + + +### Версия Cyrus с улучшенной энтопией + +```sh +for i in $(seq 1 5); do echo $(tr -dc 'A-Za-z0-9!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~' < /dev/urandom | head -c 20); done +``` + +```text +Q@2^u\U3.:%|{yGY@SMl +T8WVte55AggJ{WxElqDi +vG%+Gr"jp#x@f46YBj>m +|>Wd,|S>w)jwe|:))eLU +m`nSde+o,:vn\1JpJ1j3 +``` + +## Дополнительно + +Пожалуй добавлю в `alias`.