Comments on: Secure SSH using two-factor authentication on Ubuntu 16.04 https://www.rosehosting.com/blog/secure-your-ssh-using-two-factor-authentication-on-ubuntu-16-04/ Premium Linux Tutorials Since 2001 Fri, 03 Jun 2022 08:42:12 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: admin https://www.rosehosting.com/blog/secure-your-ssh-using-two-factor-authentication-on-ubuntu-16-04/#comment-45673 Tue, 09 May 2017 06:19:22 +0000 https://www.rosehosting.com/blog/?p=21992#comment-45673 In reply to meepmeep.

Edit the /etc/ssh/sshd_config SSH configuration and add:

UsePAM yes
AuthenticationMethods publickey,password publickey,keyboard-interactive

Edit the /etc/pam.d/sshd PAM configuration file and comment out the @include common-auth line:

# Standard Un*x authentication.
#@include common-auth

Then add/modify the following lines:

# Standard Un*x password updating.
@include common-password
auth required pam_google_authenticator.so nullok

Restart SSH for the changes to take effect.

Run google-authenticator as any users that need 2FA, and don’t run it for users where only SSH keys will be used.

]]>
By: meepmeep https://www.rosehosting.com/blog/secure-your-ssh-using-two-factor-authentication-on-ubuntu-16-04/#comment-45669 Mon, 08 May 2017 20:05:46 +0000 https://www.rosehosting.com/blog/?p=21992#comment-45669 Is it possible to enable 2FA only for specific user / group on the server ?

]]>
By: Benjamin https://www.rosehosting.com/blog/secure-your-ssh-using-two-factor-authentication-on-ubuntu-16-04/#comment-45622 Tue, 25 Apr 2017 09:41:18 +0000 https://www.rosehosting.com/blog/?p=21992#comment-45622 Please continue this great work and I look forward to more of your awesome blog posts.

]]>
By: admin https://www.rosehosting.com/blog/secure-your-ssh-using-two-factor-authentication-on-ubuntu-16-04/#comment-45617 Sat, 22 Apr 2017 05:48:22 +0000 https://www.rosehosting.com/blog/?p=21992#comment-45617 In reply to Hector.

You can implement two-factor authentication on any server.

]]>
By: Hector https://www.rosehosting.com/blog/secure-your-ssh-using-two-factor-authentication-on-ubuntu-16-04/#comment-45614 Fri, 21 Apr 2017 15:24:47 +0000 https://www.rosehosting.com/blog/?p=21992#comment-45614 Can this be implemented for any server or does it have to be a VPS? Thanks.

]]>