linux 下生成随机密码生成器

[root@localhost ~]# yum -y install pwgen
[root@localhost ~]# pwgen -ncCyB1 8 1
kei%b3Xa
[root@localhost ~]# pwgen -ncCyB1 8 2
Ahs3eib'
Yo>u7eun
[root@localhost ~]#
[root@localhost ~]# echo $RANDOM|md5sum |cut -c 1-8
d31a2fcf
# 生成数字
[root@localhost ~]# echo $RANDOM |cksum |cut -c 1-8
32022099

[root@localhost ~]# openssl rand -base64 4
nMjQSQ==
# 生成数字
[root@localhost ~]# openssl rand -base64 4 |cksum |cut -c 1-8
25050760
[root@localhost ~]# cat /proc/sys/kernel/random/uuid |cut -c 1-8
0ca50358
[root@localhost ~]# date +%N |cut -c 1-8
88573308
原文地址:https://www.cnblogs.com/lmx1002/p/10131139.html