58 lines
929 B
Markdown
58 lines
929 B
Markdown
---
|
||
title: "🔑 Генератор паролей в виде однострочника на Bash"
|
||
date: 2024-08-17T22:33:12+03:00
|
||
draft: false
|
||
tags: [shell, 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`.
|