This is an automated email from the git hooks/post-receive script. x2go pushed a commit to annotated tag 0.5.0.2 in repository x2goclient. commit 7120e88032ccdd27d0c39e479b462bf350ff4d0e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Dec 17 16:21:52 2014 +0100 Handle SSHException 'No authentication methods available' for key-only authentication attempts gracefully. --- debian/changelog | 2 ++ pyhoca/cli/frontend.py | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 37f9fcd7..9c7c22de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ pyhoca-cli (0.5.0.2-0x2go2) UNRELEASED; urgency=medium * New upstream version (0.5.0.2): - Handle SSHException 'Incompatible ssh peer (no acceptable kex algorithm)' gracefully. + - Handle SSHException 'No authentication methods available' for key-only + authentication attempts gracefully. * debian/control: + Bump Standards: to 3.9.6. No changes needed. * debian/copyright: diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py index 04b9c40b..f7566241 100644 --- a/pyhoca/cli/frontend.py +++ b/pyhoca/cli/frontend.py @@ -454,18 +454,22 @@ class PyHocaCLI(x2go.X2GoClient): try: self._X2GoClient__connect_session(self.x2go_session_hash, username=_username, password=self.args.password, force_password_auth=force_password_auth) connected = True + force_password_auth = False except x2go.PasswordRequiredException, e: self._pyhoca_logger('unlock SSH key file (%s)' % self.args.ssh_privkey, loglevel=x2go.loglevel_NOTICE, ) self.args.password = getpass.getpass() except x2go.AuthenticationException, e: force_password_auth = True - self._pyhoca_logger('interactive login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_NOTICE, ) + self._pyhoca_logger('passwordless login for ,,%s\'\' failed' % _username, loglevel=x2go.loglevel_WARN, ) + self._pyhoca_logger('proceeding to interactive login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_NOTICE, ) except x2go.BadHostKeyException: self._runtime_error('SSH host key verification for remote host [%s]:%s failed' % (self.args.server, self.args.remote_ssh_port), exitcode=-254) except x2go.SSHException, e: - if str(e) not in ('not a valid DSA private key file', 'Incompatible ssh peer (no acceptable kex algorithm)'): + if str(e) not in ('not a valid DSA private key file', 'Incompatible ssh peer (no acceptable kex algorithm)', 'No authentication methods available'): self._runtime_error(str(e), exitcode=253) force_password_auth = True + self._pyhoca_logger('passwordless login for ,,%s\'\' failed' % _username, loglevel=x2go.loglevel_WARN, ) + self._pyhoca_logger('proceeding to interactive login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_NOTICE, ) if force_password_auth: self.args.password = getpass.getpass() -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git