Closed rpayneavue closed 6 years ago
Can you run your ssh command w/ -vv
added and paste the command? And paste your full /etc/ssh/sshd_config
from the server?
We're configuring another test server and will complete your request shortly. In the mean time, here's some testing notes that have isolated it to the google-authenticator-1.04-1.el7.x86_64.rpm version:
@akerl Please see the attached. Let us know if we can provide any additional info.
Thank you!
And in your PAM config you have auth required pam_google_authenticator.so nullok
?
Ah, I think I know what this is. Same as https://github.com/google/google-authenticator-libpam/issues/75.
Could you try that same solution?
(the behaviour was changed back in January but probably took a while to get to RHEL)
Correct. Please see below configuration checks. Confirming the solution in #75 was to:
Thanks for the help!
nullok is configured to allow service account exceptions as the guidance suggests. [rpayne@wikiqatc-i-0d6999babf6fb7258 ~]$ sudo grep google /etc/pam.d/sshd auth required pam_google_authenticator.so nullok
Confirming additional article configurations: [rpayne@wikiqatc-i-0d6999babf6fb7258 ~]$ sudo grep interactive /etc/ssh/sshd_config AuthenticationMethods publickey,keyboard-interactive [rpayne@wikiqatc-i-0d6999babf6fb7258 ~]$ sudo grep ChallengeR /etc/ssh/sshd_config
ChallengeResponseAuthentication yes [rpayne@wikiqatc-i-0d6999babf6fb7258 ~]$ sudo grep substack /etc/pam.d/sshd
So all sorted? Great!
Just to correct, if future readers don't catch it (in CentOS):
Hope this helps. Thanks for your feedback helped me :) in 2019
are you (really really) sure ????
https://linux.die.net/man/8/pam_permit
pam_permit is a PAM module that always permit access. It does nothing else.
In the case of authentication, the user's name will be set to nobody if the application didn't set one. Many applications and PAM modules become confused if this name is unknown.
This module is very dangerous. It should be used with extreme caution.
Yes (if done right). In short PAM requires at least one "yes" to permit login, and requires no "no".
The described config intends that if GA is not configured, then the user should be let through. But if it's not configured then GA says neither yes nor no, it says "ignore me".
If there is any other module (e.g. pam_unix
) that says "no", then the pam_permit
does nothing.
And at least in #75 the config was publickey, then GA as second factor.
It's Friday evening, so I may not be communicating clearly, but yeah this should be right. Just don't do auth sufficient pam_permit
.
like you said, test your configuration with bad login, in my pam file for openvpn, it always granted access
Yeah I wouldn't recommend having only a module that can say "maybe" (PAM_IGNORE
) followed by pam_accept
. That's not likely to ever be what you want. This only make sense with a first factor enforced (like in #75 which as first factor has SSH pubkey).
OS: RHEL 7.4 Expectation: /etc/pam.d/sshd: "auth required pam_google_authenticator.so nullok" - This should mean that users who don’t run the Google Authenticator initialization won’t be asked for a second authentication. Problem: Users who don’t run the Google Authenticator initialization cannot login and receive the following connection error: "no supported authentication methods available (server sent keyboard-interactive)". Steps to reproduce: Configure RHEL7.4 per AWS' guidance here: https://aws.amazon.com/blogs/startups/securing-ssh-to-amazon-ec2-linux-hosts/. Try to SSH to the instance for users who have not run Google Authenticator initialization. This will generate the following connection error: "no supported authentication methods available (server sent keyboard-interactive)". Note: This was testing using public key auth.
Working with AWS, they claim this functions as intended on Amazon Linux "As mentioned before the default configuration works on Amazon Linux where configured users will authenticate with both public key and TOTP and unconfigured users will authenticate with only public key and nullok argument is working as expected and ignoring TOTP if unconfigured."
Please let me know if you need additional details.