From 95d189ca72040ab4972886c616e881b739b180e5 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 7 Mar 2020 21:34:38 -0600 Subject: [PATCH] SSH2: try logging in with none as an auth method first --- phpseclib/Net/SSH2.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 7b463de4..dc647fbe 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -2132,6 +2132,15 @@ class Net_SSH2 { $args = func_get_args(); $this->auth[] = $args; + + // try logging with 'none' as an authentication method first since that's what + // PuTTY does + if ($this->_login($username)) { + return true; + } + if (count($args) == 1) { + return false; + } return call_user_func_array(array(&$this, '_login'), $args); }