File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2343,10 +2343,6 @@ prompt_password() {
23432343 warn false " Leave blank to use a random password."
23442344 warn false " 不填写则使用随机密码"
23452345 while true ; do
2346- # 特殊字符列表
2347- # https://learn.microsoft.com/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/hh994562(v=ws.11)
2348- chars=\' ' A-Za-z0-9~!@#$%^&*_=+`|(){}[]:;"<>,.?/-'
2349- random_password=$( tr -dc " $chars " < /dev/random | head -c16)
23502346 IFS= read -r -p " Password: " password
23512347 if [ -n " $password " ]; then
23522348 IFS= read -r -p " Retype password: " password_confirm
@@ -2356,7 +2352,11 @@ prompt_password() {
23562352 error " Passwords don't match. Try again."
23572353 fi
23582354 else
2359- password=$random_password
2355+ # 特殊字符列表
2356+ # https://learn.microsoft.com/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/hh994562(v=ws.11)
2357+ # 有的机器运行 centos 7 ,用 /dev/random 产生 16 位密码,开启了 rngd 也要 5 秒,关闭了 rngd 则长期阻塞
2358+ chars=\' ' A-Za-z0-9~!@#$%^&*_=+`|(){}[]:;"<>,.?/-'
2359+ password=$( tr -dc " $chars " < /dev/urandom | head -c16)
23602360 break
23612361 fi
23622362 done
You can’t perform that action at this time.
0 commit comments