|
|
@@ -590,9 +590,6 @@ namespace Renci.SshNet
|
|
|
|
|
|
// Some server implementations might sent this message first, prior establishing encryption algorithm
|
|
|
RegisterMessage("SSH_MSG_USERAUTH_BANNER");
|
|
|
-
|
|
|
- // Modern versions of OpenSSH server use this generic message for various proprietary extensions of the SSH protocol.
|
|
|
- RegisterMessage("SSH_MSG_GLOBAL_REQUEST");
|
|
|
|
|
|
// mark the message listener threads as started
|
|
|
_messageListenerCompleted.Reset();
|
|
|
@@ -621,11 +618,13 @@ namespace Renci.SshNet
|
|
|
throw new SshException("Username is not specified.");
|
|
|
}
|
|
|
|
|
|
+ // Some servers send a global request immediately after successful authentication
|
|
|
+ // Avoid race condition by already enabling SSH_MSG_GLOBAL_REQUEST before authentication
|
|
|
+ RegisterMessage("SSH_MSG_GLOBAL_REQUEST");
|
|
|
+
|
|
|
ConnectionInfo.Authenticate(this, _serviceFactory);
|
|
|
_isAuthenticated = true;
|
|
|
|
|
|
- Thread.Sleep(2000);
|
|
|
-
|
|
|
// Register Connection messages
|
|
|
RegisterMessage("SSH_MSG_REQUEST_SUCCESS");
|
|
|
RegisterMessage("SSH_MSG_REQUEST_FAILURE");
|