"Bash 랜덤 패스워드 생성"의 두 판 사이의 차이

12번째 줄: 12번째 줄:
</syntaxhighlight>
</syntaxhighlight>


==alnum (base62)==
==base 62 (alnum)==
<syntaxhighlight lang='console'>
<syntaxhighlight lang='console'>
testuser@localhost:~$ cat /dev/urandom | tr -cd "[:alnum:]" | head -c 16; echo
testuser@localhost:~$ cat /dev/urandom | tr -cd "[:alnum:]" | head -c 16; echo

2021년 6월 9일 (수) 01:58 판

1 개요

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

2 base 16

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

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

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

7 같이 보기

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