Subject: x2goclient SSH fails with keyboard-interactive + banner
From: Andrew Cherry <[email-masked]>
To: <[email-masked]>
Date: Fri, 20 Nov 2015 11:50:49 -0500

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;