fix: generation of MFA secret under FreeBSD

This commit is contained in:
Stéphane Lesimple 2024-02-20 13:46:03 +00:00 committed by Stéphane Lesimple
parent 867410a16d
commit e2a45596d0

View file

@ -1272,7 +1272,7 @@ if [ "${opt[generate-mfa-secret]}" = 1 ]; then
if [ -e "$BASTION_ETC_DIR/mfa-token.conf" ]; then
action_na
else
secret=$(tr -dc A-Za-z0-9 < /dev/urandom 2>/dev/null | head -c32)
secret=$(env LANG=C tr -dc A-Za-z0-9 < /dev/urandom 2>/dev/null | head -c32)
touch "$BASTION_ETC_DIR/mfa-token.conf"
chown 0:bastion-users "$BASTION_ETC_DIR/mfa-token.conf"
chmod 640 "$BASTION_ETC_DIR/mfa-token.conf"