I have an Ubuntu server that I have physical access to and is currently only accessible via the local area network.

I am considering allowing myself to connect remotely and - whilst I realise a properly configured SSH login is already quite secure - I would like to explore additional options for reinforcing security.

With that in mind - is there any method of adding two tier verification to an attempted login via SSH?

Ideally I would imagine this goes along the lines of:

  • Login via User@my.server.ip.1
  • Initial authentication via public/private key pairs
  • Additional prompt for a form of two tier verification, most likely a request for a google auth code paired with my mobile device, but if there was a neat service that could ping me a text or email I'd also be up for that.

Further context: I am the sole user of this server and will be the only individual using the SSH access.

Bonus question: Is there any setup to send a notification email/message to an account upon sucessful login?

  • 1
    there is pam_google_auth module which can help you to achieve this behaviour. And I believe it was solved somewhere around here. – Jakuje Sep 14 '15 at 15:29

Jakuje is on the right track. A bit of googling let me to an article that gives you exactly what you need. Just got done setting up my own server to use google authenticator on my phone. Instead of repeating the directions, here's the URL where I found the answer:


  • Vixter that looks great, I'll give you the answer here and follow up with a summary of the article below in-case that link ever goes dead! – Huw Nov 18 '15 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.