How do I make ssh two factor authentication last for more than a few hours?
Hey guys , I have configured two factor authentication for ssh on my centos 7 droplet with google authenticator .
It works as expected for a few hours i.e 10 to 12 hours after which instead of asking for verification code and then password, it asks only for password.
It then refuses all connections even if we enter the right password.
I also see a lot of failed login attempts and wonder if that has anything to do with the problem.
I tried to change my ssh port to 4444 but when i try to connect to it via ssh the connection times out and so I had to change my port back to 22.
Also 2fA over ssh works normally if i manually reboot my droplet, but only for the next 10 to 12 hours.
Any help will be greatly appreciated.