Two factor authentication issue

Hi,

I managed to enable Two Factor Auth for the root user, worked flawlessly. I tried to activate this feature for other users with a LDAP provider, the option is there and seems to work until I press SAVE and then it disables itself.

Anyone else having this issue?

Thanks

What is your operating system & version , browser and version please

Never seen this :-?

could you reformulate please, I did not catch you

I try to enable Two Factor authentication for a new user I created. It worked for root. When I try to enable it for a new user I create, I go through the process of scanning the code, entering the code and then saving. After I press SAVE, the page is reloaded and Two Factor authentication is disabled.

please output

once the error occurs, press F12 and check in the console of your browser.

Looks like you need sudo permissions to perform that operation. So perhaps it is a root only feature?

  1. “/usr/bin/sudo exited with code 1”, toString: ƒ}

  2. problem: null

  3. exit_status: 1

  4. exit_signal: null

  5. message: “/usr/bin/sudo exited with code 1”

  6. toString: Ć’ ()

  7. proto: Object

the error comes from the App.vue line 617

  context.execHints(

but not related, we should not allow a sudo permission to show hints to users

You miss to answer my question

What is your operating system & version , browser and version please

The browser is fine. It is not a browser issue otherwise it would not have worked with the ROOT user. And I specified it did. But the browser is OPERA. Same thing with Chrome, Firefox, EDGE, you name it.

can you find the 2FA files inside the home of user

[root@prometheus ~]# ll /var/lib/nethserver/home/zorro/ -la
lrwxrwxrwx  1 zorro@domain.com domain users@domain.com   42 Apr 13 00:31 .2fa_cockpit.secret -> /var/lib/nethserver/home/zorro/.2fa.secret
-rw-------  1 zorro@domain.com domain users@domain.com   41 Apr 13 00:31 .2fa.secret
lrwxrwxrwx  1 zorro@domain.com domain users@domain.com   42 Apr 13 00:31 .2fa_sshd.secret -> /var/lib/nethserver/home/zorro/.2fa.secret

what is the window version you use

Definitively I cannot reproduce, just tested again with a new user.

Hmm I’m not sure what the version of Windows would have to do with this but it is Windows 10. I wouldn’t be able to create a two factor auth with root if Windows 10 was an issue. Did you enable Two factor auth for your root?

OK so here is what I found out… A user I created BEFORE creating the Active Directory had everything stored in /home/{username}. Whenever I would try to enable 2FA for that user, it wouldn’t work. I tried to create 2FA for a user I created AFTER the AD was configured and it works. But now I’m facing another issue. I stored all of my SSH keys for each user in their home directories which works as long as they are in /home/{username}/.ssh and everything in file authorized_keys. This is the case for root and for another user I had BEFORE creating the AD. Every user AFTER the AD will not check for ssh keys in their respective folders under /var/lib/nethserver/home/{username}/.ssh

Is that a bug?

I created a new user : zorro, without any permission :slight_smile:

you have probably broken something in the ENV vars, if you look to

grep -srn 'HOME' /etc/

you can see that it is a really important option

the user that cannot connect with ssh keys, what is the ENV{HOME} output

do env in the terminal of the user

I will check as soon as I can fix my NIC problem which is stuck with a bridge even after uninstalling the AD. Super strange.

I looked at my environment setting for HOME. My HOME is correctly setup : HOME=/var/lib/nethserver/home/admin

1 Like