Skip to content

Instantly share code, notes, and snippets.

@lawvs
Last active November 6, 2021 11:57
Show Gist options
  • Save lawvs/7d54e73234a3aedcd1829919197fa889 to your computer and use it in GitHub Desktop.
Save lawvs/7d54e73234a3aedcd1829919197fa889 to your computer and use it in GitHub Desktop.
生成随机密码
#!/bin/bash
# 使用 openssl 生成密码
openssl rand -base64 12
# 使用 dd 命令生成密码
dd if=/dev/urandom bs=1 count=15 2>/dev/null|base64 -w 0
# 使用 md5sum 生成密码
date |md5sum
# 使用 gpg 工具生成密码
gpg --gen-random --armor 1 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment