getumbrel / umbrel

A beautiful home server OS for self-hosting with an app store. Buy a pre-built Umbrel Home with umbrelOS, or install on a Raspberry Pi or any x86 system.
https://umbrel.com
Other
7.22k stars 522 forks source link

2FA after restart won't work #1179

Open ArbenKarb opened 2 years ago

ArbenKarb commented 2 years ago

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

How can I disable 2FA via ssh?

scooterson commented 2 years ago

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})"

ArbenKarb commented 2 years ago

Thanks, doesnt work for me either. Same errors.

r1979 commented 2 years ago

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

mayankchhabra commented 2 years ago

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}
aerdna89 commented 2 years ago

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!

ashtanmistal commented 7 months ago

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).