Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh client integration via paramiko #1646

Closed
totaam opened this issue Sep 18, 2017 · 11 comments
Closed

ssh client integration via paramiko #1646

totaam opened this issue Sep 18, 2017 · 11 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Sep 18, 2017

Rather than calling putty plink or ssh, we could rely on paramiko which would give us tighter integration with the ssh authentication, allowing us to do things like:

This may help with #1421: Xpra-Launcher closes silently after clicking connect - missing feedback until application shows up

@totaam
Copy link
Collaborator Author

totaam commented May 7, 2018

see also ssh plink fix: r19411

@totaam
Copy link
Collaborator Author

totaam commented Jul 16, 2018

Initial support for paramiko ssh added in r19933. It works pretty well and allows us to see meaningful debug messages with -d ssh.
It doesn't ask for password or key passphrases yet and it isn't the default (requires --ssh=paramiko), but individual authentication mechanisms can be turned off for testing, ie:

XPRA_SSH_AGENT_AUTH=0 xpra attach ssh://username:password@127.0.0.1/ -d ssh --ssh=ssh

Still TODO:

  • we need to either poll + wait for the "run-xpra" command to see if it runs (and risk running it multiple times if it fails) or duplicate the ugly if+else code used by plain ssh, yuk
  • read from stderr and do something with it - maybe just log it
  • socket info assumes we have a real socket (we do, but it's hidden), override the info method for ssh transport
  • GUI for passphrase / password, accepting new / changed host keys (hard because this code runs before the main loop - we may need to exec a utility)
  • disable those prompts when running embedded without a display (ie: proxy backend connections)
  • make it the default, show the alternative in the config file
  • add to macos jhbuild, msys2 installation - deal with py2app and cx_freeze bundling
  • add deb and rpm dependencies

@totaam
Copy link
Collaborator Author

totaam commented Jul 17, 2018

See #1892 comment 13 : we should aim to support more login shells than the current ssh / plink solution.

@totaam
Copy link
Collaborator Author

totaam commented Jul 17, 2018

r19937:

  • checks each remote-xpra option
  • reads stderr
  • fixes socket info

@totaam
Copy link
Collaborator Author

totaam commented Jul 20, 2018

Updates:

  • r19938 adds the tty prompts for password and key passphrases.
  • r19941: GUI for confirming host keys
  • r19943: GUI for password and key passphrase input
  • r19945: use "auto" for ssh option, default to paramiko if it is installed - DEB and RPM dependency added (but not for centos7 as this would require EPEL)
  • r19946: better window-size tuning and env vars to configure (window-size, timeout)
  • wiki updates: [SSH], [Network](../wiki/SSH], [../wiki/Network), [SSH], [Network](../wiki/SSH], [../wiki/Network), etc
  • r19950: moved code to a submodule
  • SSH server support #1920 builtin SSH server support
  • r19960 + r19961 macos jhbuild paramiko module

Still TODO:

  • unit tests
  • maybe the GUI should be fullscreen? grab keyboard / mouse?
  • win32 and macos packaging
  • find a way to make paramiko use the same host keys as openssh, to avoid host key warnings for known hosts when switching over to paramiko

@totaam
Copy link
Collaborator Author

totaam commented Jul 29, 2018

platform and compatibility woes:

@totaam
Copy link
Collaborator Author

totaam commented Aug 3, 2018

Workaround for installing pynacl on win32:

pacman -S mingw-w64-i686-libsodium
export SODIUM_INSTALL=system
easy_install-3.7 -U -Z pynacl

Applied to setup files in r20009.

@totaam
Copy link
Collaborator Author

totaam commented Aug 3, 2018

Updates:

  • r20008: use ssh logger for ssh initialization errors
  • r20009: build pynacl against the system libsodium library
  • r20011: tell cx_freeze that we need pynacl bundled
  • r20040 + r20041: support code for openssh's ssh.exe binary with --ssh=ssh on ms windows (does not work - refuses to read or write from our pipes it seems), including the ssh-pageant-git would allow it to talk to putty's pagent key agent too

@totaam
Copy link
Collaborator Author

totaam commented Aug 20, 2018

Minor updates:

  • r20137 default to paramiko on macos
  • r20135 better debug output

This ticket should solve non-bash login shell issues, see #1892#comment:16. Note: paramiko is not the default on win32 because plink already provides a GUI there, might as well stick to it, for now anyway.

For server SSH support see #1920, follow up ticket: #1937

@maxmylyn: we now provide a much better UI for SSH connections on macos and Linux (use --ssh="ssh -x" to revert to running openssh in a subprocess), the same UI can be enabled on win32 with --ssh=paramiko.

@totaam
Copy link
Collaborator Author

totaam commented Aug 24, 2018

2018-08-24 23:41:35: maxmylyn commented


Played around with this for a while today as well and everything seems to be behaving nicely - checked with both Fedora and MacOS.

Noted and closing.

@totaam totaam closed this as completed Aug 24, 2018
@totaam
Copy link
Collaborator Author

totaam commented Apr 23, 2019

See also: #1937, #2097, #2448, #2549

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant