diff options
Diffstat (limited to 'svr-runopts.c')
-rw-r--r-- | svr-runopts.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/svr-runopts.c b/svr-runopts.c index f2e8b89..7b76dca 100644 --- a/svr-runopts.c +++ b/svr-runopts.c @@ -81,6 +81,7 @@ static void printhelp(const char * progname) { "-s Disable password logins\n" "-g Disable password logins for root\n" "-B Allow blank password logins\n" + "-t Enable two-factor authentication (both password and public key required)\n" #endif "-T Maximum authentication tries (default %d)\n" #if DROPBEAR_SVR_LOCALTCPFWD @@ -159,6 +160,7 @@ void svr_getopts(int argc, char ** argv) { svr_opts.noauthpass = 0; svr_opts.norootpass = 0; svr_opts.allowblankpass = 0; + svr_opts.multiauthmethod = 0; svr_opts.maxauthtries = MAX_AUTH_TRIES; svr_opts.inetdmode = 0; svr_opts.portcount = 0; @@ -297,6 +299,9 @@ void svr_getopts(int argc, char ** argv) { case 'B': svr_opts.allowblankpass = 1; break; + case 't': + svr_opts.multiauthmethod = 1; + break; #endif case 'h': printhelp(argv[0]); @@ -447,6 +452,10 @@ void svr_getopts(int argc, char ** argv) { } #endif + if (svr_opts.multiauthmethod && svr_opts.noauthpass) { + dropbear_exit("-t and -s are incompatible"); + } + #if DROPBEAR_PLUGIN if (pubkey_plugin) { svr_opts.pubkey_plugin = m_strdup(pubkey_plugin); |