vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Jan F. Chadima cff1d0
diff -up openssh-5.9p1/auth.h.2auth openssh-5.9p1/auth.h
Jan F. Chadima cff1d0
--- openssh-5.9p1/auth.h.2auth	2011-05-29 13:39:38.000000000 +0200
Jan F. Chadima 28b0dc
+++ openssh-5.9p1/auth.h	2011-09-17 11:36:54.314522599 +0200
Jan F. Chadima 69dd72
@@ -149,6 +149,8 @@ int	auth_root_allowed(char *);
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
 char	*auth2_read_banner(void);
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
+void	userauth_restart(const char *);
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
 void	privsep_challenge_enable(void);
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
 int	auth2_challenge(Authctxt *, char *);
Jan F. Chadima cff1d0
diff -up openssh-5.9p1/auth2.c.2auth openssh-5.9p1/auth2.c
Jan F. Chadima cff1d0
--- openssh-5.9p1/auth2.c.2auth	2011-05-05 06:04:11.000000000 +0200
Jan F. Chadima 28b0dc
+++ openssh-5.9p1/auth2.c	2011-09-17 11:36:54.402521709 +0200
Jan F. Chadima 28b0dc
@@ -290,6 +290,24 @@ input_userauth_request(int type, u_int32
Jan F. Chadima 69dd72
 }
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
 void
Jan F. Chadima 69dd72
+userauth_restart(const char *method)
Jan F. Chadima 69dd72
+{
Jan F. Chadima 69dd72
+	options.two_factor_authentication = 0;
Jan F. Chadima 69dd72
+
Jan F. Chadima 28b0dc
+	debug2("userauth restart, method = %s", method);
Jan F. Chadima 69dd72
+	options.pubkey_authentication = options.second_pubkey_authentication && strcmp(method, method_pubkey.name);
Jan F. Chadima 69dd72
+#ifdef GSSAPI
Jan F. Chadima 69dd72
+	options.gss_authentication = options.second_gss_authentication && strcmp(method, method_gssapi.name);
Jan F. Chadima 69dd72
+#endif
Jan F. Chadima 69dd72
+#ifdef JPAKE
Jan F. Chadima 69dd72
+	options.zero_knowledge_password_authentication = options.second_zero_knowledge_password_authentication && strcmp(method, method_jpake.name);
Jan F. Chadima 69dd72
+#endif
Jan F. Chadima 69dd72
+	options.password_authentication = options.second_password_authentication && strcmp(method, method_passwd.name);
Jan F. Chadima 69dd72
+	options.kbd_interactive_authentication = options.second_kbd_interactive_authentication && strcmp(method, method_kbdint.name);
Jan F. Chadima 69dd72
+	options.hostbased_authentication = options.second_hostbased_authentication && strcmp(method, method_hostbased.name);
Jan F. Chadima 69dd72
+}
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
+void
Jan F. Chadima 69dd72
 userauth_finish(Authctxt *authctxt, int authenticated, char *method)
Jan F. Chadima 69dd72
 {
Jan F. Chadima 69dd72
 	char *methods;
Jan F. Chadima 28b0dc
@@ -337,6 +355,12 @@ userauth_finish(Authctxt *authctxt, int
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
 	/* XXX todo: check if multiple auth methods are needed */
Jan F. Chadima 69dd72
 	if (authenticated == 1) {
Jan F. Chadima 69dd72
+		if (options.two_factor_authentication) {
Jan F. Chadima 69dd72
+			userauth_restart(method);
Jan F. Chadima 69dd72
+			debug("1st factor authentication done go to 2nd factor");
Jan F. Chadima 69dd72
+			goto ask_methods;
Jan F. Chadima 69dd72
+		}
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
 		/* turn off userauth */
Jan F. Chadima 69dd72
 		dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &dispatch_protocol_ignore);
Jan F. Chadima 69dd72
 		packet_start(SSH2_MSG_USERAUTH_SUCCESS);
Jan F. Chadima 28b0dc
@@ -356,7 +380,9 @@ userauth_finish(Authctxt *authctxt, int
Jan F. Chadima 69dd72
 #endif
Jan F. Chadima 69dd72
 			packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
Jan F. Chadima 69dd72
 		}
Jan F. Chadima 69dd72
+ask_methods:
Jan F. Chadima 69dd72
 		methods = authmethods_get();
Jan F. Chadima 28b0dc
+		debug2("next auth methods = %s", methods);
Jan F. Chadima 69dd72
 		packet_start(SSH2_MSG_USERAUTH_FAILURE);
Jan F. Chadima 69dd72
 		packet_put_cstring(methods);
Jan F. Chadima 28b0dc
 		packet_put_char(0);	/* XXX partial success, unused */
Jan F. Chadima cff1d0
diff -up openssh-5.9p1/monitor.c.2auth openssh-5.9p1/monitor.c
Jan F. Chadima 28b0dc
--- openssh-5.9p1/monitor.c.2auth	2011-08-05 22:15:18.000000000 +0200
Jan F. Chadima 28b0dc
+++ openssh-5.9p1/monitor.c	2011-09-17 11:36:54.513491937 +0200
Jan F. Chadima 28b0dc
@@ -417,6 +417,10 @@ monitor_child_preauth(Authctxt *_authctx
Jan F. Chadima 28b0dc
 			}
Jan F. Chadima 28b0dc
 		}
Jan F. Chadima 69dd72
 #endif
Jan F. Chadima 28b0dc
+		if (authenticated && options.two_factor_authentication) {
Jan F. Chadima 28b0dc
+			userauth_restart(auth_method);
Jan F. Chadima 28b0dc
+			authenticated = 0;
Jan F. Chadima 28b0dc
+		}
Jan F. Chadima 69dd72
 	}
Jan F. Chadima 69dd72
 
Jan F. Chadima 28b0dc
 	/* Drain any buffered messages from the child */
Jan F. Chadima cff1d0
diff -up openssh-5.9p1/servconf.c.2auth openssh-5.9p1/servconf.c
Jan F. Chadima 28b0dc
--- openssh-5.9p1/servconf.c.2auth	2011-06-23 00:30:03.000000000 +0200
Jan F. Chadima 28b0dc
+++ openssh-5.9p1/servconf.c	2011-09-17 11:36:54.632461730 +0200
Jan F. Chadima 69dd72
@@ -92,6 +92,13 @@ initialize_server_options(ServerOptions
Jan F. Chadima 69dd72
 	options->hostbased_uses_name_from_packet_only = -1;
Jan F. Chadima 69dd72
 	options->rsa_authentication = -1;
Jan F. Chadima 69dd72
 	options->pubkey_authentication = -1;
Jan F. Chadima 69dd72
+	options->two_factor_authentication = -1;
Jan F. Chadima 69dd72
+	options->second_pubkey_authentication = -1;
Jan F. Chadima 69dd72
+	options->second_gss_authentication = -1;
Jan F. Chadima 69dd72
+	options->second_password_authentication = -1;
Jan F. Chadima 69dd72
+	options->second_kbd_interactive_authentication = -1;
Jan F. Chadima 69dd72
+	options->second_zero_knowledge_password_authentication = -1;
Jan F. Chadima 69dd72
+	options->second_hostbased_authentication = -1;
Jan F. Chadima 69dd72
 	options->kerberos_authentication = -1;
Jan F. Chadima 69dd72
 	options->kerberos_or_local_passwd = -1;
Jan F. Chadima 69dd72
 	options->kerberos_ticket_cleanup = -1;
Jan F. Chadima 69dd72
@@ -237,6 +244,20 @@ fill_default_server_options(ServerOption
Jan F. Chadima 69dd72
 		options->permit_empty_passwd = 0;
Jan F. Chadima 69dd72
 	if (options->permit_user_env == -1)
Jan F. Chadima 69dd72
 		options->permit_user_env = 0;
Jan F. Chadima 69dd72
+	if (options->two_factor_authentication == -1)
Jan F. Chadima 69dd72
+		options->two_factor_authentication = 0;
Jan F. Chadima 69dd72
+	if (options->second_pubkey_authentication == -1)
Jan F. Chadima 69dd72
+		options->second_pubkey_authentication = 1;
Jan F. Chadima 69dd72
+	if (options->second_gss_authentication == -1)
Jan F. Chadima 69dd72
+		options->second_gss_authentication = 0;
Jan F. Chadima 69dd72
+	if (options->second_password_authentication == -1)
Jan F. Chadima 69dd72
+		options->second_password_authentication = 1;
Jan F. Chadima 69dd72
+	if (options->second_kbd_interactive_authentication == -1)
Jan F. Chadima 69dd72
+		options->second_kbd_interactive_authentication = 0;
Jan F. Chadima 69dd72
+	if (options->second_zero_knowledge_password_authentication == -1)
Jan F. Chadima 69dd72
+		options->second_zero_knowledge_password_authentication = 0;
Jan F. Chadima 69dd72
+	if (options->second_hostbased_authentication == -1)
Jan F. Chadima 69dd72
+		options->second_hostbased_authentication = 0;
Jan F. Chadima 69dd72
 	if (options->use_login == -1)
Jan F. Chadima 69dd72
 		options->use_login = 0;
Jan F. Chadima 69dd72
 	if (options->compression == -1)
Jan F. Chadima 69dd72
@@ -316,8 +337,11 @@ typedef enum {
Jan F. Chadima 69dd72
 	sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem,
Jan F. Chadima 69dd72
 	sMaxStartups, sMaxAuthTries, sMaxSessions,
Jan F. Chadima 69dd72
 	sBanner, sUseDNS, sHostbasedAuthentication,
Jan F. Chadima 69dd72
-	sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
Jan F. Chadima 69dd72
-	sClientAliveCountMax, sAuthorizedKeysFile,
Jan F. Chadima 69dd72
+	sHostbasedUsesNameFromPacketOnly, sTwoFactorAuthentication,
Jan F. Chadima 69dd72
+	sSecondPubkeyAuthentication, sSecondGssAuthentication,
Jan F. Chadima 69dd72
+	sSecondPasswordAuthentication, sSecondKbdInteractiveAuthentication,
Jan F. Chadima 69dd72
+	sSecondZeroKnowledgePasswordAuthentication, sSecondHostbasedAuthentication,
Jan F. Chadima 69dd72
+	sClientAliveInterval, sClientAliveCountMax, sAuthorizedKeysFile,
Jan F. Chadima 69dd72
 	sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel,
Jan F. Chadima 69dd72
 	sMatch, sPermitOpen, sForceCommand, sChrootDirectory,
Jan F. Chadima 69dd72
 	sUsePrivilegeSeparation, sAllowAgentForwarding,
Jan F. Chadima 69dd72
@@ -395,6 +419,21 @@ static struct {
Jan F. Chadima 69dd72
 #else
Jan F. Chadima 69dd72
 	{ "zeroknowledgepasswordauthentication", sUnsupported, SSHCFG_ALL },
Jan F. Chadima 69dd72
 #endif
Jan F. Chadima 69dd72
+	{ "twofactorauthentication", sTwoFactorAuthentication, SSHCFG_ALL },
Jan F. Chadima 69dd72
+	{ "secondpubkeyauthentication", sSecondPubkeyAuthentication, SSHCFG_ALL },
Jan F. Chadima 69dd72
+#ifdef GSSAPI
Jan F. Chadima 69dd72
+	{ "secondgssapiauthentication", sSecondGssAuthentication, SSHCFG_ALL },
Jan F. Chadima 69dd72
+#else
Jan F. Chadima 69dd72
+	{ "secondgssapiauthentication", sUnsupported, SSHCFG_ALL },
Jan F. Chadima 69dd72
+#endif
Jan F. Chadima 69dd72
+	{ "secondpasswordauthentication", sSecondPasswordAuthentication, SSHCFG_ALL },
Jan F. Chadima 69dd72
+	{ "secondkbdinteractiveauthentication", sSecondKbdInteractiveAuthentication, SSHCFG_ALL },
Jan F. Chadima 69dd72
+#ifdef JPAKE
Jan F. Chadima 69dd72
+	{ "secondzeroknowledgepasswordauthentication", sSecondZeroKnowledgePasswordAuthentication, SSHCFG_ALL },
Jan F. Chadima 69dd72
+#else
Jan F. Chadima 69dd72
+	{ "secondzeroknowledgepasswordauthentication", sUnsupported, SSHCFG_ALL },
Jan F. Chadima 69dd72
+#endif
Jan F. Chadima 69dd72
+	{ "secondhostbasedauthentication", sSecondHostbasedAuthentication, SSHCFG_ALL },
Jan F. Chadima 69dd72
 	{ "checkmail", sDeprecated, SSHCFG_GLOBAL },
Jan F. Chadima 69dd72
 	{ "listenaddress", sListenAddress, SSHCFG_GLOBAL },
Jan F. Chadima 69dd72
 	{ "addressfamily", sAddressFamily, SSHCFG_GLOBAL },
Jan F. Chadima 69dd72
@@ -982,6 +1021,34 @@ process_server_config_line(ServerOptions
Jan F. Chadima 69dd72
 		intptr = &options->challenge_response_authentication;
Jan F. Chadima 69dd72
 		goto parse_flag;
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
+	case sTwoFactorAuthentication:
Jan F. Chadima 69dd72
+		intptr = &options->two_factor_authentication;
Jan F. Chadima 69dd72
+		goto parse_flag;
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
+	case sSecondPubkeyAuthentication:
Jan F. Chadima 69dd72
+		intptr = &options->second_pubkey_authentication;
Jan F. Chadima 69dd72
+		goto parse_flag;
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
+	case sSecondGssAuthentication:
Jan F. Chadima 69dd72
+		intptr = &options->second_gss_authentication;
Jan F. Chadima 69dd72
+		goto parse_flag;
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
+	case sSecondPasswordAuthentication:
Jan F. Chadima 69dd72
+		intptr = &options->second_password_authentication;
Jan F. Chadima 69dd72
+		goto parse_flag;
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
+	case sSecondKbdInteractiveAuthentication:
Jan F. Chadima 69dd72
+		intptr = &options->second_kbd_interactive_authentication;
Jan F. Chadima 69dd72
+		goto parse_flag;
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
+	case sSecondZeroKnowledgePasswordAuthentication:
Jan F. Chadima 69dd72
+		intptr = &options->second_zero_knowledge_password_authentication;
Jan F. Chadima 69dd72
+		goto parse_flag;
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
+	case sSecondHostbasedAuthentication:
Jan F. Chadima 69dd72
+		intptr = &options->second_hostbased_authentication;
Jan F. Chadima 69dd72
+		goto parse_flag;
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
 	case sPrintMotd:
Jan F. Chadima 69dd72
 		intptr = &options->print_motd;
Jan F. Chadima 69dd72
 		goto parse_flag;
Jan F. Chadima 69dd72
@@ -1491,14 +1558,21 @@ void
Jan F. Chadima 69dd72
 copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
Jan F. Chadima 69dd72
 {
Jan F. Chadima 69dd72
 	M_CP_INTOPT(password_authentication);
Jan F. Chadima 69dd72
+	M_CP_INTOPT(second_password_authentication);
Jan F. Chadima 69dd72
 	M_CP_INTOPT(gss_authentication);
Jan F. Chadima 69dd72
+	M_CP_INTOPT(second_gss_authentication);
Jan F. Chadima 69dd72
 	M_CP_INTOPT(rsa_authentication);
Jan F. Chadima 69dd72
 	M_CP_INTOPT(pubkey_authentication);
Jan F. Chadima 69dd72
+	M_CP_INTOPT(second_pubkey_authentication);
Jan F. Chadima 69dd72
 	M_CP_INTOPT(kerberos_authentication);
Jan F. Chadima 69dd72
 	M_CP_INTOPT(hostbased_authentication);
Jan F. Chadima 69dd72
+	M_CP_INTOPT(second_hostbased_authentication);
Jan F. Chadima 69dd72
 	M_CP_INTOPT(hostbased_uses_name_from_packet_only);
Jan F. Chadima 69dd72
 	M_CP_INTOPT(kbd_interactive_authentication);
Jan F. Chadima 69dd72
+	M_CP_INTOPT(second_kbd_interactive_authentication);
Jan F. Chadima 69dd72
 	M_CP_INTOPT(zero_knowledge_password_authentication);
Jan F. Chadima 69dd72
+	M_CP_INTOPT(second_zero_knowledge_password_authentication);
Jan F. Chadima 69dd72
+	M_CP_INTOPT(two_factor_authentication);
Jan F. Chadima 69dd72
 	M_CP_INTOPT(permit_root_login);
Jan F. Chadima 69dd72
 	M_CP_INTOPT(permit_empty_passwd);
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
@@ -1720,17 +1794,24 @@ dump_config(ServerOptions *o)
Jan F. Chadima 69dd72
 #endif
Jan F. Chadima 69dd72
 #ifdef GSSAPI
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sGssAuthentication, o->gss_authentication);
Jan F. Chadima 69dd72
+	dump_cfg_fmtint(sSecondGssAuthentication, o->second_gss_authentication);
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sGssCleanupCreds, o->gss_cleanup_creds);
Jan F. Chadima 69dd72
 #endif
Jan F. Chadima 69dd72
 #ifdef JPAKE
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sZeroKnowledgePasswordAuthentication,
Jan F. Chadima 69dd72
 	    o->zero_knowledge_password_authentication);
Jan F. Chadima 69dd72
+	dump_cfg_fmtint(sSecondZeroKnowledgePasswordAuthentication,
Jan F. Chadima 69dd72
+	    o->second_zero_knowledge_password_authentication);
Jan F. Chadima 69dd72
 #endif
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sPasswordAuthentication, o->password_authentication);
Jan F. Chadima 69dd72
+	dump_cfg_fmtint(sSecondPasswordAuthentication, o->second_password_authentication);
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sKbdInteractiveAuthentication,
Jan F. Chadima 69dd72
 	    o->kbd_interactive_authentication);
Jan F. Chadima 69dd72
+	dump_cfg_fmtint(sSecondKbdInteractiveAuthentication,
Jan F. Chadima 69dd72
+	    o->second_kbd_interactive_authentication);
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sChallengeResponseAuthentication,
Jan F. Chadima 69dd72
 	    o->challenge_response_authentication);
Jan F. Chadima 69dd72
+	dump_cfg_fmtint(sTwoFactorAuthentication, o->two_factor_authentication);
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sPrintMotd, o->print_motd);
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sPrintLastLog, o->print_lastlog);
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sX11Forwarding, o->x11_forwarding);
Jan F. Chadima cff1d0
diff -up openssh-5.9p1/servconf.h.2auth openssh-5.9p1/servconf.h
Jan F. Chadima cff1d0
--- openssh-5.9p1/servconf.h.2auth	2011-06-23 00:30:03.000000000 +0200
Jan F. Chadima 28b0dc
+++ openssh-5.9p1/servconf.h	2011-09-17 11:36:54.749584245 +0200
Jan F. Chadima 69dd72
@@ -112,6 +112,14 @@ typedef struct {
Jan F. Chadima 69dd72
 					/* If true, permit jpake auth */
Jan F. Chadima 69dd72
 	int     permit_empty_passwd;	/* If false, do not permit empty
Jan F. Chadima 69dd72
 					 * passwords. */
Jan F. Chadima 69dd72
+	int	two_factor_authentication;	/* If true, the first sucessful authentication
Jan F. Chadima 69dd72
+					 * will be followed by the second one from anorher set */
Jan F. Chadima 69dd72
+	int	second_pubkey_authentication;	/* second set of authentications */
Jan F. Chadima 69dd72
+	int	second_gss_authentication;
Jan F. Chadima 69dd72
+	int	second_password_authentication;
Jan F. Chadima 69dd72
+	int	second_kbd_interactive_authentication;
Jan F. Chadima 69dd72
+	int	second_zero_knowledge_password_authentication;
Jan F. Chadima 69dd72
+	int	second_hostbased_authentication;
Jan F. Chadima 69dd72
 	int     permit_user_env;	/* If true, read ~/.ssh/environment */
Jan F. Chadima 69dd72
 	int     use_login;	/* If true, login(1) is used */
Jan F. Chadima 69dd72
 	int     compression;	/* If true, compression is allowed */
Jan F. Chadima cff1d0
diff -up openssh-5.9p1/sshd_config.2auth openssh-5.9p1/sshd_config
Jan F. Chadima cff1d0
--- openssh-5.9p1/sshd_config.2auth	2011-05-29 13:39:39.000000000 +0200
Jan F. Chadima 28b0dc
+++ openssh-5.9p1/sshd_config	2011-09-17 11:36:54.859588726 +0200
Jan F. Chadima 69dd72
@@ -87,6 +87,13 @@ AuthorizedKeysFile	.ssh/authorized_keys
Jan F. Chadima 69dd72
 # and ChallengeResponseAuthentication to 'no'.
Jan F. Chadima 69dd72
 #UsePAM no
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
+#TwoFactorAuthentication no
Jan F. Chadima 69dd72
+#SecondPubkeyAuthentication yes
Jan F. Chadima 69dd72
+#SecondHostbasedAuthentication no
Jan F. Chadima 69dd72
+#SecondPasswordAuthentication yes
Jan F. Chadima 28b0dc
+#SecondKBDInteractiveAuthentication yes
Jan F. Chadima 69dd72
+#SecondGSSAPIAuthentication no
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
 #AllowAgentForwarding yes
Jan F. Chadima 69dd72
 #AllowTcpForwarding yes
Jan F. Chadima 69dd72
 #GatewayPorts no
Jan F. Chadima cff1d0
diff -up openssh-5.9p1/sshd_config.5.2auth openssh-5.9p1/sshd_config.5
Jan F. Chadima cff1d0
--- openssh-5.9p1/sshd_config.5.2auth	2011-08-05 22:17:33.000000000 +0200
Jan F. Chadima 28b0dc
+++ openssh-5.9p1/sshd_config.5	2011-09-17 13:45:49.022521436 +0200
Jan F. Chadima 69dd72
@@ -726,6 +726,12 @@ Available keywords are
Jan F. Chadima 69dd72
 .Cm PubkeyAuthentication ,
Jan F. Chadima 69dd72
 .Cm RhostsRSAAuthentication ,
Jan F. Chadima 69dd72
 .Cm RSAAuthentication ,
Jan F. Chadima 69dd72
+.Cm SecondGSSAPIAuthentication ,
Jan F. Chadima 69dd72
+.Cm SecondHostbasedAuthentication ,
Jan F. Chadima 69dd72
+.Cm SecondKbdInteractiveAuthentication ,
Jan F. Chadima 69dd72
+.Cm SecondPasswordAuthentication ,
Jan F. Chadima 69dd72
+.Cm SecondPubkeyAuthentication ,
Jan F. Chadima 69dd72
+.Cm TwoFactorAuthentication ,
Jan F. Chadima 69dd72
 .Cm X11DisplayOffset ,
Jan F. Chadima 69dd72
 .Cm X11Forwarding
Jan F. Chadima 69dd72
 and
Jan F. Chadima 28b0dc
@@ -931,6 +937,45 @@ Specifies whether pure RSA authenticatio
Jan F. Chadima 69dd72
 The default is
Jan F. Chadima 69dd72
 .Dq yes .
Jan F. Chadima 69dd72
 This option applies to protocol version 1 only.
Jan F. Chadima 69dd72
+.It Cm SecondGSSAPIAuthentication
Jan F. Chadima 69dd72
+Specifies whether the
Jan F. Chadima 69dd72
+.Cm GSSAPIAuthentication
Jan F. Chadima 69dd72
+may be used on the second authentication while
Jan F. Chadima 69dd72
+.Cm TwoFactorAuthentication
Jan F. Chadima 69dd72
+is set.
Jan F. Chadima 28b0dc
+The default is
Jan F. Chadima 28b0dc
+.Dq no .
Jan F. Chadima 69dd72
+.It Cm SecondHostbasedAuthentication
Jan F. Chadima 69dd72
+Specifies whether the
Jan F. Chadima 69dd72
+.Cm HostbasedAuthentication
Jan F. Chadima 69dd72
+may be used on the second authentication while
Jan F. Chadima 69dd72
+.Cm TwoFactorAuthentication
Jan F. Chadima 69dd72
+is set.
Jan F. Chadima 28b0dc
+The default is
Jan F. Chadima 28b0dc
+.Dq no .
Jan F. Chadima 69dd72
+.It Cm SecondKbdInteractiveAuthentication
Jan F. Chadima 69dd72
+Specifies whether the
Jan F. Chadima 69dd72
+.Cm KbdInteractiveAuthentication
Jan F. Chadima 69dd72
+may be used on the second authentication while
Jan F. Chadima 69dd72
+.Cm TwoFactorAuthentication
Jan F. Chadima 69dd72
+is set.
Jan F. Chadima 28b0dc
+The default is
Jan F. Chadima 28b0dc
+.Dq yes .
Jan F. Chadima 69dd72
+.It Cm SecondPasswordAuthentication
Jan F. Chadima 69dd72
+Specifies whether the
Jan F. Chadima 69dd72
+.Cm PasswordAuthentication
Jan F. Chadima 69dd72
+may be used on the second authentication while
Jan F. Chadima 69dd72
+.Cm TwoFactorAuthentication
Jan F. Chadima 69dd72
+is set.
Jan F. Chadima 28b0dc
+The default is
Jan F. Chadima 28b0dc
+.Dq yes .
Jan F. Chadima 69dd72
+Specifies whether the
Jan F. Chadima 69dd72
+.Cm PubkeyAuthentication
Jan F. Chadima 69dd72
+may be used on the second authentication while
Jan F. Chadima 69dd72
+.Cm TwoFactorAuthentication
Jan F. Chadima 69dd72
+is set.
Jan F. Chadima 28b0dc
+The default is
Jan F. Chadima 28b0dc
+.Dq yes .
Jan F. Chadima 69dd72
 .It Cm ServerKeyBits
Jan F. Chadima 69dd72
 Defines the number of bits in the ephemeral protocol version 1 server key.
Jan F. Chadima 69dd72
 The minimum value is 512, and the default is 1024.
Jan F. Chadima 28b0dc
@@ -1011,6 +1056,23 @@ For more details on certificates, see th
Jan F. Chadima 69dd72
 .Sx CERTIFICATES
Jan F. Chadima 69dd72
 section in
Jan F. Chadima 69dd72
 .Xr ssh-keygen 1 .
Jan F. Chadima 69dd72
+.It Cm TwoFactorAuthentication
Jan F. Chadima 69dd72
+Specifies whether for a successful login is necessary to meet two independent authentications.
Jan F. Chadima 69dd72
+If select the first method is selected from the set of allowed methods from
Jan F. Chadima 69dd72
+.Cm GSSAPIAuthentication ,
Jan F. Chadima 69dd72
+.Cm HostbasedAuthentication ,
Jan F. Chadima 69dd72
+.Cm KbdInteractiveAuthentication ,
Jan F. Chadima 69dd72
+.Cm PasswordAuthentication ,
Jan F. Chadima 69dd72
+.Cm PubkeyAuthentication .
Jan F. Chadima 69dd72
+And the second method is selected from the set of allowed methods from
Jan F. Chadima 69dd72
+.Cm SecondGSSAPIAuthentication ,
Jan F. Chadima 69dd72
+.Cm SecondHostbasedAuthentication ,
Jan F. Chadima 69dd72
+.Cm SecondKbdInteractiveAuthentication ,
Jan F. Chadima 69dd72
+.Cm SecondPasswordAuthentication ,
Jan F. Chadima 69dd72
+.Cm SecondPubkeyAuthentication 
Jan F. Chadima 69dd72
+without the method used for the first authentication.
Jan F. Chadima 28b0dc
+The default is
Jan F. Chadima 28b0dc
+.Dq no .
Jan F. Chadima 69dd72
 .It Cm UseDNS
Jan F. Chadima 69dd72
 Specifies whether
Jan F. Chadima 69dd72
 .Xr sshd 8