很多時候,就是想設置一個随機密碼,但是感覺随便亂打出來的不是很“随機”。
date %s |sha256sum |base64 |head -c 16
tr 參數:
-c或——complerment:取代所有不屬于第一字符集的字符;
-d或——delete:删除所有屬于第一字符集的字符;
生成 16 個随機字符(包含數字,大寫字母,小寫字母,特殊字符)
< /dev/urandom tr -dc 0-9-A-Z-a-z-/|head -c 16
strings 顯示文件中的可打印字符
strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 16 | tr -d '\n'
openssl rand -base64 24
需要安裝 openssl
命令有很多,能快速滿足需求即可。
,
更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!