LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-09-2016, 02:48 PM   #1
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
Is there a way to force a 2-Factor Authentication Code for SSH if a key is used?


Is there a way to force a 2-Factor Authentication Code for SSH if a key is used?

Specifically with pam_google_authenticator.so

Regular SSH password login:
Code:
$ ssh terry@11.11.11.11
Verification code: 
Password:
SSH login using key:
Code:
$ ssh terry@11.11.11.11
Last login: Tue Aug  9 19:32:39 2016 from 11.11.11.12
[terry@centos7 ~]$
In sshd_config, if I have:
Code:
AuthenticationMethods keyboard-interactive
it requires the code and a password.

If I have:
Code:
AuthenticationMethods publickey
It allow access with no code.

So basically it looks like it needs keyboard-interactive for the code, but also requires a password if that's set.

If there another option for code and key?

How can I get it to ask for the Verification Code before accepting the key?

Last edited by abefroman; 08-09-2016 at 05:04 PM.
 
Old 08-10-2016, 08:48 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
This may be of interest to you: http://serverfault.com/questions/629...ator-working-o
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Securing SSH with two factor authentication using Google Authenticator LXer Syndicated Linux News 1 08-06-2014 12:54 PM
LXer: How to set up two-factor authentication for SSH login on Linux LXer Syndicated Linux News 0 07-07-2014 10:11 AM
LXer: Two-Factor Authentication System for Apache and SSH LXer Syndicated Linux News 0 05-15-2014 12:42 AM
LXer: SSH Two-factor authentication - Google authenticator LXer Syndicated Linux News 0 04-24-2013 07:41 PM
SSH + PAM + two-factor authentication tdnnash25 Linux - Security 21 06-18-2009 04:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration