Bash 랜덤 패스워드 생성

1 개요

random complex password generator
랜덤 패스워드 생성

2 base 16

head /dev/urandom | md5sum
head /dev/urandom | sha1sum
$ head /dev/urandom | md5sum
295a3aa99c41bbe8cad13c86d1cd3b5b  -
$ head /dev/urandom | sha1sum
7e8578e965b45bd000439bb36eb40de31b8133b8  -

3 base 62 (alnum)

testuser@localhost:~$ cat /dev/urandom | tr -cd "[:alnum:]" | head -c 16; echo
hdjOc1gjcaOGUE2G
testuser@localhost:~$ cat /dev/urandom | tr -cd "[:alnum:]" | head -c 32; echo
88PUO0LiJNSYhmkxhGQzRTmUlQwNMEWz

4 base 64

base64 /dev/urandom | head -c32
$ base64 /dev/urandom | head -c32
M5WB9OTY0fiydZkoBZVhLw07s1O8tRw
$ base64 /dev/urandom | head -c32
9+0SO/FD9r+v7YM1o3juS9573hojBxwK

5 기타

testuser@localhost:~$ cat /dev/urandom | tr -cd "[:alnum:][:graph:]" | head -c 16
N~#:+?sf}`J8Q)O5
testuser@localhost:~$ cat /dev/urandom | tr -cd "[:alnum:][:graph:]" | head -c 32
~MlO~{rMH-Q>~KN}L&f$FzH!PP];&Jl$

6 관리자도 알 수 없는 랜덤 패스워드 지정

명령어
echo '계정명:$(head /dev/urandom | md5sum) | chpasswd
실행예시
[root@zetawiki ~]# echo 'testuser:$(head /dev/urandom | md5sum) | chpasswd
Changing password for user testuser.
passwd: all authentication tokens updated successfully.

7 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}