shell generates random numbers

1:random

[root@linhexiao shellTest]# echo "$RANDOM"
[root@linhexiao shellTest]# echo "$RANDOM$(date +%N%t)"|md5sum |cut -c 5-12

 2:openssl

[root@linhexiao shellTest]# openssl rand -base64 8
[root@linhexiao shellTest]# openssl rand -base64 8|md5sum | cut -c 5-12

 3:date

[root@linhexiao shellTest]# date +%s
1460550703
[root@linhexiao shellTest]# date +%s%N

 4:

[root@linhexiao shellTest]# head /dev/urandom|cksum
4036467423 2069

 5:UUID

cat /proc/sys/kernel/random/uuid

 6:expect

[root@linhexiao shellTest]# yum -y install expect
[root@linhexiao shellTest]# mkpasswd
?l4oIiw6u
[root@linhexiao shellTest]# mkpasswd -l 10
r5th7FWlg;
[root@linhexiao shellTest]# mkpasswd -l 10 -s 0
3fn2aObtXt

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326654499&siteId=291194637