1

In response to the users that flagged this as a potential duplicate, it is not. I have a SSH hardening solution, which I got off Canonical's ubuntu tutorials and is commonly repeated, but it isn't working, as I outlined below.

On my Ubuntu 18.04 box I've attempted to setup two-factor authentication for SSH per this tutorial, however when I attempt to login via SSH it fails. I'm prompted for my username as normal, then my password. No matter what it returns "Access denied" when I've entered my password. If I comment out

auth required pam_google_authenticator.so

from /etc/pam.d/sshd then SSH works again, but obviously without two-factor. What is stopping my password from being accepted?

Jason
  • 21
  • 1
  • 5
  • 3
    Possible duplicate of [Secure an Ubuntu OpenSSH server from Brute force attacks but without a firewall or SSH key pair?](https://askubuntu.com/questions/903911/secure-an-ubuntu-openssh-server-from-brute-force-attacks-but-without-a-firewall) - read the [answer](https://askubuntu.com/a/904035/566421) of mine there. – pa4080 Feb 27 '19 at 06:12
  • 1
    In my case, I fixed this with sudo systemctl restart sshd.service – Jon Jul 14 '20 at 19:06

1 Answers1

1

Never mind, I got it to work. The .google_authenticator file was not created properly in my home directory (not sure why though, possibly I ran google-authenticator under the wrong user, possibly as root?), so after re-running it everything works fine.

Jason
  • 21
  • 1
  • 5