google / google-authenticator-libpam

Apache License 2.0
1.76k stars 281 forks source link

where is the config file of google authenticator? #179

Closed JadeVane closed 3 years ago

JadeVane commented 3 years ago

I would like to be able to backup google authenticator configurations and then restore those configurations on another device instead of manually running google-authenticator to regenerate a configuration file

Is there any way to do this?

ThomasHabets commented 3 years ago

It's in your home directory. ~/.google_authenticator.

JadeVane commented 3 years ago

@ThomasHabets

Thanks for getting back to me in the first place.

I've tried restoring the config file to another device, but the config file doesn't seem to work until I run google-authenticator.

google-authenticator is used for ssh login now.

ThomasHabets commented 3 years ago

Are the permissions correct when you restore? chmod 600 ~/.google_authenticator

But then "it doesn't work" is not a good bug report. Check your log files.

JadeVane commented 3 years ago

chmod 600 ~/.google_authenticator did solve my problem, thanks.

Logging in with ssh -v might tell something:

debug1: Authentications that can continue: keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: keyboard-interactive
debug1: No more authentication methods to try.
jade@xx.xx.xx.xx: Permission denied (keyboard-interactive).

I just dono what Permission denied means, now it's clear.