[X2Go-Dev] Bug#966: x2goclient SSH fails with keyboard-interactive + banner

Andrew Cherry acherry at alcf.anl.gov
Fri Nov 20 17:50:49 CET 2015


Package: x2goclient
Version: 4.0.5.1

On our systems, security policy requires us to use OTP tokens for login, which means that all SSH connections are keyboard-interactive.  In addition, we use /etc/issue.net to print a warning banner before the SSH password prompt.  When x2goclient connects, the string variable containing the output for the password prompt ('pr' in sshmasterconnection.cpp) includes the banner as well, and since the check for "Password: " is a strict equality check, the password prompt is not recognized.

The simple patch below seems to do the trick to get around this issue:


--- sshmasterconnection.cpp	2015-11-20 11:37:44.000000000 -0500
+++ /Users/acherry/sshmasterconnection.cpp	2015-11-20 11:37:24.000000000 -0500
@@ -866,7 +866,7 @@
             x2goDebug<<"Prompt[0]: |"<<prompt<<"|"<<endl;
 #endif
             QString pr=prompt;
-            if(pr=="Password: ")
+            if(pr.endsWith("Password: "))
             {
 #ifdef DEBUG
                 x2goDebug<<"Password request"<<endl;
@@ -874,7 +874,7 @@
                 ssh_userauth_kbdint_setanswer(my_ssh_session,0,pass.toAscii());
                 return userChallengeAuth();
             }
-            if(pr=="Verification code: ")
+            if(pr.endsWith("Verification code: "))
             {
 #ifdef DEBUG
                 x2goDebug<<"Verification code request"<<endl;


More information about the x2go-dev mailing list