google / google-authenticator-libpam

Apache License 2.0
1.75k stars 280 forks source link

Verification code not matching with google authenticator app on phone #226

Open bahjat1993 opened 1 year ago

bahjat1993 commented 1 year ago

Describe the bug

The verification code that the system is generating does not match up with the verification code that is generated on the google authenticator app. I have ensured that the google authenticator app is up to date. I use the google authenticator app on my phone for other keys and they all seem to work

To Reproduce

I simple just send the commands: sudo apt install libpam-google-authenticator followed by: google-authenticator

image

The linux image i am using is ubuntu server 20.0. If you need any additional information please let me know.

ThomasHabets commented 1 year ago

How about the phone, does that have the right time?

(yes I did see that it works for other keys. It's just that I think every time code doesn't match, it's been related to bad time on a device)

ThomasHabets commented 1 year ago

Oh, actually could you also confirm that the emergency codes (as seen below the QR code) work? That way you can confirm that the PAM / SSH setup is correct.

bahjat1993 commented 1 year ago

How about the phone, does that have the right time?

(yes I did see that it works for other keys. It's just that I think every time code doesn't match, it's been related to bad time on a device)

Firstly thank you for the reply.

My original thought was that the phone doesn't have the correct time. So i followed the instructions which were "Click 3 dots in the top right corner" click "seettings" click "time correction for codes" then click "sync now". I am presented with a message that states "Time already correct authenticators internal clock was not adjusted because it appears to already be in sync with google servers".

I did the above steps before posting this bug

bahjat1993 commented 1 year ago

Oh, actually could you also confirm that the emergency codes (as seen below the QR code) work? That way you can confirm that the PAM / SSH setup is correct.

I've tried doing this upon startup following these instructions link . I am presented with the option to enter verification code, i enter my emergency scratch codes. It then asks me to enter my password. I do that and it gives me an error code saying login is incorrect

ThomasHabets commented 1 year ago

Ok, if the scratch codes don't work either, then it's not about a correct clock setting.

It could be that you're running SELinux, which won't allow you to read/write stuff in your home dir, including the GA config.

What do the auth logs say?