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