Subject: Bug#1121: x2goclient Doesn't Use libssh Config File

From: Matthew Rubenstein <[email-masked]>
Date: Fri, 02 Dec 2016 13:27:48 -0500

Package: x2goclient
Version: 4.0.5.1
Severity: wishlist

	Hello. x2goclient uses libssh but does not use a client config
file the way libssh can, ssh_options_parse_config()
http://api.libssh.org/master/group__libssh__session.html#ga82371e723260
c7572ea061edecc2e9f1

	~/.ssh/config or /etc/ssh_config are essential for client
configuration  of the ssh connection over which x2go sessions run.
Among other important configurations are Ciphers and KexAlgorithms
specifications, with which a client can require only trusted crypto
algorithms or else refuse connection. The current code simply
negotiates whichever algorithm is the first match in the hardcoded
libssh list to whatever the remote sshd specifies (eg. in its
sshd_config file). The agreed algorithm is currently not exposed to the
x2goclient user, but specifying it in the client config file would make
it knowable by the user depending on it. There are many other
configurations the config file could specify, to make x2goclient meet
user requirements, even just "work the same as my other ssh sessions"
where libssh supports those features.

	The Session preferences dialog's Connection tab could expose a
file open dialog to select a config file. That file open dialog could
default to the user's .ssh directory, or else to the directory
specified in the Session tab's "Use RSA/DSA key [...]" value if any.

--
[email-masked]
718-233-5097

---

From: Mihai Moldovan <[email-masked]>
Date: Wed, 22 Feb 2017 11:22:33 +0100

> specified in the Session tab's "Use RSA/DSA key [...]" value if any.

I didn't implement this part, though. Could do it, but then what would be the
right place for it? General preferences, so that you can define it globally?
Per-session? Would mean passing this option around all the time, though.

I think we're fine with just parsing the default config file for now.

If really strictly needed, I can always implement a setting for this later. For
now let's keep it like this - at least we *have* config file parsing now.

I think I should explain some nifty features, though.

For a specific shortname, you can set the Host, User and Port parameters in the
config file as well. I implemented support for that as well, but it's a bit
non-obvious to use.

For using the address specified in the config file, simply supply the shortname
in the session's host field.

Likewise, to make X2Go Client use the user name specified in the ssh client
config file, leave the username field in the session config EMPTY. (Note that
this a bit tricky, because if your ssh client config does NOT specify a user
name for this shortname and you leave the field empty, X2Go Client will instead
connect with the username you are currently logged in on your local machine.)

To use the port specified in the ssh client config file for the specified
shortname, set a port number of 0 in the session config. (Note: also tricky,
because if you didn't set a proper port in the ssh client config file but 0 as
the port number in the session config, libssh will use the default port - 22.)

All this works for both a direct connection and an SSH-proxied connection.

Mihai