umbrel icon indicating copy to clipboard operation
umbrel copied to clipboard

2FA after restart won't work

Open ArbenKarb opened this issue 3 years ago • 6 comments

After restarting, google authenticator doesn't generate valid keys for umbrel 2FA anymore.

How can I disable 2FA via ssh?

ArbenKarb avatar Jan 02 '22 15:01 ArbenKarb

Any luck? been having same issue. Was told this would work but i get two errors after. would love some help also

json_file="/home/umbrel/umbrel/db/user.json" && contents="$(jq ‘del(.otpUri)’ ${json_file})" && echo “${contents}” > ${json_file}

Result: -bash: command substitution: line 2: syntax error near unexpected token `(’

-bash: command substitution: line 2: `jq ‘del(.otpUri)’ ${json_file})"

scooterson avatar Jan 05 '22 21:01 scooterson

Thanks, doesnt work for me either. Same errors.

ArbenKarb avatar Jan 09 '22 19:01 ArbenKarb

I also experience the issue; please let me know if I can help by sharing any specific logs and/or debug information.

r1979 avatar Jan 11 '22 08:01 r1979

Sorry for the issue. Can you please try running this to disable 2FA (there's a slight difference in the comma in this command):

json_file="/home/umbrel/umbrel/db/user.json" && contents="$(jq 'del(.otpUri)' ${json_file})" && echo "${contents}" > ${json_file}

mayankchhabra avatar Jan 13 '22 13:01 mayankchhabra

I had the same problem and I solved by manually substituting the alphanumeric string with the null string ("") at the key "otpUri" in the file /home/umbrel/umbre/db/user.json. Now, I would like to reactivate the 2FA but the code displayed in Authy does not work. I don't think it is related to the time. Any ideas? Thank you!

aerdna89 avatar Jul 23 '22 12:07 aerdna89

For anyone coming across this issue now, what I found worked for disabling 2FA is

sudo bash -c 'json_file="user.json"; contents="$(jq "del(.otpUri)" ${json_file})"; echo "${contents}" > ${json_file}'

as if you're not already in a shell with sudo privileges, the direct command above gives permission denied and just calling sudo in front of it doesn't elevate the entire command.

It's a 2 year old thread -- but it's what directly comes up when searching for 2fa related issues on the repo. 2fa still seems broken, afaik, as I've had this issue happen a few times where 2fa codes are always incorrect. Looks to happen when the domain changes (e.g. umbrel.local as opposed to your local IP address as opposed to a Tailscale IP).

ashtanmistal avatar Feb 18 '24 02:02 ashtanmistal