This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2gobroker. from 32e3527 For user context changes: set the HOME dir of the new user correctly. new 912b7f0 Reduce Paramiko/SSH verbosity (logging.ERROR) when connecting to remote broker agents. new 8a1c4c5 Support adding remote broker agent's host keys via the x2gobroker-testagent tool. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 4 ++++ sbin/x2gobroker-testagent | 8 ++++++++ x2gobroker/agent.py | 8 +++++++- 3 files changed, 19 insertions(+), 1 deletion(-) -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gobroker. commit 8a1c4c54cc83ee136b59f91f04607adf047d74e0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Mar 19 13:25:33 2014 +0100 Support adding remote broker agent's host keys via the x2gobroker-testagent tool. --- debian/changelog | 2 ++ sbin/x2gobroker-testagent | 8 ++++++++ x2gobroker/agent.py | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e1e4fa1..c3e10ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -105,6 +105,8 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low - For user context changes: set the HOME dir of the new user correctly. - Reduce Paramiko/SSH verbosity (logging.ERROR) when connecting to remote broker agents. + - Support adding remote broker agent's host keys via the x2gobroker-testagent + tool. * debian/control: + Replace LDAP support with session brokerage support in LONG_DESCRIPTION. + Fix SYNOPSIS texts. diff --git a/sbin/x2gobroker-testagent b/sbin/x2gobroker-testagent index 3d6b825..f73bb0b 100755 --- a/sbin/x2gobroker-testagent +++ b/sbin/x2gobroker-testagent @@ -26,6 +26,7 @@ import types import setproctitle import argparse import logging +from paramiko import AutoAddPolicy # perform an authentication against the authentication mechanism configured for WSGI try: @@ -58,6 +59,7 @@ if __name__ == "__main__": {'args':['-p','--port'], 'default': 22, 'metavar': 'PORT', 'help': 'For remote agent calls (via SSH) use this port as SSH port (default: 22)', }, ] supplementary_options = [ + {'args':['-A', '--add-to-known-hosts'], 'default': False, 'action': 'store_true', 'help': 'For SSH connections to a remote broker agent: permanently add the remote system\'s host key to the list of known hosts', }, {'args':['--session-id'], 'default': None, 'help': 'when testing the \'suspendsession\' or the \'terminatesession\' task, you have to additionally give a session ID to test the tasks on', }, {'args':['--pubkey'], 'default': None, 'help': 'use this public key when testing the \'addauthkey\' and the \'delauthkey\' task', }, ] @@ -124,6 +126,12 @@ query_mode = local_agent and 'LOCAL' or 'SSH' if local_agent: remote_agent = None else: remote_agent = {'hostname': hostname, 'port': port, } +if remote_agent and cmdline_args.add_to_known_hosts: + remote_agent.update({ + 'host_key_policy': AutoAddPolicy(), + }) + + def call_agent(task, **kwargs): try: _result = agent_client_tasks[task](username=username, query_mode=query_mode, remote_agent=remote_agent, **kwargs) diff --git a/x2gobroker/agent.py b/x2gobroker/agent.py index 2bb92da..169f62e 100644 --- a/x2gobroker/agent.py +++ b/x2gobroker/agent.py @@ -132,6 +132,8 @@ def call_remote_broker_agent(username, mode, cmdline_args=[], remote_agent=None) """ if remote_agent is None: logger_error.error('With the SSH agent-query-mode a remote agent host (hostname, port) has to be specified!') + elif not remote_agent.has_key('host_key_policy'): + remote_agent['host_key_policy'] = paramiko.WarningPolicy() cmd_line = [ '{x2gobroker_agent_binary}'.format(x2gobroker_agent_binary=x2gobroker.defaults.X2GOBROKER_AGENT_CMD), @@ -153,7 +155,7 @@ def call_remote_broker_agent(username, mode, cmdline_args=[], remote_agent=None) try: client = paramiko.SSHClient() client.load_system_host_keys() - client.set_missing_host_key_policy(paramiko.WarningPolicy()) + client.set_missing_host_key_policy(remote_agent['host_key_policy']) client.connect(remote_hostname, remote_port, remote_username, look_for_keys=True, allow_agent=True) result = [] -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gobroker. commit 912b7f060efaee58f3e1be41fe02e5f5cf46859c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Mar 19 12:56:11 2014 +0100 Reduce Paramiko/SSH verbosity (logging.ERROR) when connecting to remote broker agents. --- debian/changelog | 2 ++ x2gobroker/agent.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 99d9efe..e1e4fa1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -103,6 +103,8 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low use for authentication to X2Go Servers. - broker agent: avoid one option system() calls in Perl. - For user context changes: set the HOME dir of the new user correctly. + - Reduce Paramiko/SSH verbosity (logging.ERROR) when connecting to remote + broker agents. * debian/control: + Replace LDAP support with session brokerage support in LONG_DESCRIPTION. + Fix SYNOPSIS texts. diff --git a/x2gobroker/agent.py b/x2gobroker/agent.py index f198ce1..2bb92da 100644 --- a/x2gobroker/agent.py +++ b/x2gobroker/agent.py @@ -27,6 +27,10 @@ import cStringIO import time import threading import socket +import logging + +paramiko_logger = paramiko.util.logging.getLogger() +paramiko_logger.setLevel(logging.ERROR) import x2gobroker._paramiko x2gobroker._paramiko.monkey_patch_paramiko() -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git