Skip to content

Unable to get SSH tunneling to work #8439

Open

Description

@j9ac9k

I'm using a windows client attempting to connect to an existing python kernel on an unbuntu server VM by following the guide here: https://github.com/ipython/ipython/wiki/Cookbook:-Connecting-to-a-remote-kernel-via-ssh

Upon running

[client] $ ipython qtconsole --existing ./kernel-1234.json --ssh server

I get the following error:

PS C:\Users\ogi> ipython qtconsole --existing .\Downloads\kernel-15235.json --ssh hwvmsrv
C:\Users\ogi\Miniconda3\lib\site-packages\paramiko\client.py:580: UserWarning: Unknown ssh-rsa host key for hwvmsrv: b'9
6b38225fac1d25f1f78ebb913d32f3d'
  (key.get_name(), hostname, hexlify(key.get_fingerprint())))
[IPythonQtConsoleApp] ERROR | Could not setup tunnels
Traceback (most recent call last):
  File "C:\Users\ogi\Miniconda3\lib\site-packages\IPython\consoleapp.py", line 239, in init_ssh
    newports = tunnel_to_kernel(info, self.sshserver, self.sshkey)
  File "C:\Users\ogi\Miniconda3\lib\site-packages\IPython\kernel\connect.py", line 357, in tunnel_to_kernel
    if tunnel.try_passwordless_ssh(sshserver, sshkey):
  File "C:\Users\ogi\Miniconda3\lib\site-packages\zmq\ssh\tunnel.py", line 78, in try_passwordless_ssh
    return f(server, keyfile)
  File "C:\Users\ogi\Miniconda3\lib\site-packages\zmq\ssh\tunnel.py", line 122, in _try_passwordless_paramiko
    look_for_keys=True)
  File "C:\Users\ogi\Miniconda3\lib\site-packages\paramiko\client.py", line 307, in connect
    look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)
  File "C:\Users\ogi\Miniconda3\lib\site-packages\paramiko\client.py", line 444, in _auth
    key = pkey_class.from_private_key_file(key_filename, password)
  File "C:\Users\ogi\Miniconda3\lib\site-packages\paramiko\pkey.py", line 183, in from_private_key_file
    key = cls(filename=filename, password=password)
  File "C:\Users\ogi\Miniconda3\lib\site-packages\paramiko\rsakey.py", line 55, in __init__
    self._from_private_key_file(filename, password)
  File "C:\Users\ogi\Miniconda3\lib\site-packages\paramiko\rsakey.py", line 165, in _from_private_key_file
    data = self._read_private_key_file('RSA', filename, password)
  File "C:\Users\ogi\Miniconda3\lib\site-packages\paramiko\pkey.py", line 254, in _read_private_key_file
    with open(filename, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: ''

I installed paramiko, however still having no success.

Suggestions?

Activity

  1. j9ac9k commented on May 17, 2015

    @j9ac9k
    Author

    I should note, that I did create a RSA public/private key pair, and added the public key to authorized_keys file in my servers's ~/.ssh directory.

    Using git-bash, I was able to confirm that the SSH key's was working, however I still get the same error:

    ogi@OGI-DESKTOP ~/Downloads
    $ ipython qtconsole --existing ./kernel-2050.json --ssh hwvmsrv
    c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\client.py:580: UserWarning: U
    nknown ssh-rsa host key for hwvmsrv: b'96b38225fac1d25f1f78ebb913d32f3d'
      (key.get_name(), hostname, hexlify(key.get_fingerprint())))
    [IPythonQtConsoleApp] ERROR | Could not setup tunnels
    Traceback (most recent call last):
      File "c:\Users\ogi\Miniconda3\lib\site-packages\IPython\consoleapp.py", line 2
    39, in init_ssh
        newports = tunnel_to_kernel(info, self.sshserver, self.sshkey)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\IPython\kernel\connect.py", li
    ne 357, in tunnel_to_kernel
        if tunnel.try_passwordless_ssh(sshserver, sshkey):
      File "c:\Users\ogi\Miniconda3\lib\site-packages\zmq\ssh\tunnel.py", line 78, i
    n try_passwordless_ssh
        return f(server, keyfile)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\zmq\ssh\tunnel.py", line 122,
    in _try_passwordless_paramiko
        look_for_keys=True)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\client.py", line 307,
     in connect
        look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\client.py", line 444,
     in _auth
        key = pkey_class.from_private_key_file(key_filename, password)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\pkey.py", line 183, i
    n from_private_key_file
        key = cls(filename=filename, password=password)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\rsakey.py", line 55,
    in __init__
        self._from_private_key_file(filename, password)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\rsakey.py", line 165,
     in _from_private_key_file
        data = self._read_private_key_file('RSA', filename, password)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\pkey.py", line 254, i
    n _read_private_key_file
        with open(filename, 'r') as f:
    FileNotFoundError: [Errno 2] No such file or directory: ''
    
    ogi@OGI-DESKTOP ~/Downloads
    $ ssh ogi@hwvmsrv
    Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-37-generic x86_64)
    
     * Documentation:  https://help.ubuntu.com/
    
      System information as of Sat May 16 20:22:02 PDT 2015
    
      System load:  0.0                Processes:           107
      Usage of /:   35.2% of 17.58GB   Users logged in:     1
      Memory usage: 6%                 IP address for eth0: 10.0.2.15
      Swap usage:   0%                 IP address for eth1: 192.168.56.101
    
      Graph this data and manage this system at:
        https://landscape.canonical.com/
    
    Last login: Sat May 16 20:22:03 2015 from 192.168.56.1
    ogi@hwvmsrv:~$
    
  2. takluyver commented on May 17, 2015

    @takluyver
    Member

    Is your paramiko up to date? Where is the private key saved on your local machine. You can see where paramiko looks here.

    I think there's a bug in paramiko, at least in that it should fail earlier with a more meaningful error, rather than trying to open '' as a file.

  3. j9ac9k commented on May 17, 2015

    @j9ac9k
    Author

    Paramiko is version 1.15.2, pycrypto is 2.6.1.

    On my local machine, my keys are in ~/.ssh ; or more specifically: "C:\Users\ogi\.ssh\id_rsa"

    How would it be best to try and isolate the bug to paramiko itself; or should I open an issue in their repo?

  4. takluyver commented on May 17, 2015

    @takluyver
    Member

    The relevant lines of code running in pyzmq are here:

    https://github.com/zeromq/pyzmq/blob/v14.6.0/zmq/ssh/tunnel.py#L117

    If you can replicate the error by running just those lines, that isolates it to Paramiko.

  5. j9ac9k commented on May 18, 2015

    @j9ac9k
    Author

    Thanks for following up.

    I guess this looks like a problem with paramiko:

    ogi@OGI-DESKTOP ~/Downloads
    $ ssh ogi@hwvmsrv
    Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-37-generic x86_64)
    
     * Documentation:  https://help.ubuntu.com/
    
      System information as of Sun May 17 17:06:06 PDT 2015
    
      System load:  0.0                Processes:           106
      Usage of /:   31.6% of 17.58GB   Users logged in:     1
      Memory usage: 5%                 IP address for eth0: 192.168.1.130
      Swap usage:   0%
    
      Graph this data and manage this system at:
        https://landscape.canonical.com/
    
    0 packages can be updated.
    0 updates are security updates.
    
    Last login: Sun May 17 17:06:07 2015 from 192.168.1.120
    ogi@hwvmsrv:~$ exit
    logout
    Connection to hwvmsrv closed.
    
    ogi@OGI-DESKTOP ~/Downloads
    $ ipython
    Python 3.4.3 |Continuum Analytics, Inc.| (default, Mar  6 2015, 12:06:10) [MSC v
    .1600 64 bit (AMD64)]
    Type "copyright", "credits" or "license" for more information.
    
    IPython 3.1.0 -- An enhanced Interactive Python.
    Anaconda is brought to you by Continuum Analytics.
    Please check out: http://continuum.io/thanks and https://binstar.org
    ?         -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help      -> Python's own help system.
    object?   -> Details about 'object', use 'object??' for extra details.
    
    In [1]: import paramiko
    
    In [2]: client = paramiko.SSHClient()
    
    In [3]: client.load_system_host_keys()
    
    In [4]: server = 'hwvmsrv'
    
    In [5]: username = 'ogi'
    
    In [6]: port = 22
    
    In [7]: keyfile = "C:\\Users\\ogi\\.ssh\\id_rsa"
    
    In [8]: client.connect(server, port, username=username, key_filename=keyfile, lo
    ok_for_keys=True)
    ---------------------------------------------------------------------------
    SSHException                              Traceback (most recent call last)
    <ipython-input-8-68c07a1ff1cf> in <module>()
    ----> 1 client.connect(server, port, username=username, key_filename=keyfile, lo
    ok_for_keys=True)
    
    c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\client.py in connect(self, ho
    stname, port, username, password, pkey, key_filename, timeout, allow_agent, look
    _for_keys, compress, sock, gss_auth, gss_kex, gss_deleg_creds, gss_host, banner_
    timeout)
        286                 # will raise exception if the key is rejected; let that
    fall out
        287                 self._policy.missing_host_key(self, server_hostkey_name,
    
    --> 288                                               server_key)
        289                 # if the callback returns, assume the key is ok
        290                 our_server_key = server_key
    
    c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\client.py in missing_host_key
    (self, client, hostname, key)
        568         client._log(DEBUG, 'Rejecting %s host key for %s: %s' %
        569                     (key.get_name(), hostname, hexlify(key.get_fingerpri
    nt())))
    --> 570         raise SSHException('Server %r not found in known_hosts' % hostna
    me)
        571
        572
    
    SSHException: Server 'hwvmsrv' not found in known_hosts
    

    Line 1 of my known_hosts file (in the same directory as my RSA key) is

    hwvmsrv,192.168.1.130 ecdsa-sha2-nistp256 AAAAE2VjZHNh...
    

    triple dot indicating the key extends a ways.

  6. takluyver commented on May 18, 2015

    @takluyver
    Member

    Ah, looking at that more closely, I think the original problem may not be in paramiko - it looks like we're passing in an empty string for keyfile. Possibly we should be passing None if a key is not specified instead. @minrk ?

    Don't know about the new error.

  7. j9ac9k commented on May 18, 2015

    @j9ac9k
    Author

    I'll open up an issue regarding the known_hosts extension and see what they have to say.

    Thanks for investigating.

  8. Carreau commented on Jun 12, 2015

    @Carreau
    Member

    Has this been solved ?

  9. j9ac9k commented on Jun 12, 2015

    @j9ac9k
    Author

    Will investigate this weekend
    On Jun 12, 2015 11:19 AM, "Matthias Bussonnier" [email protected]
    wrote:

    Has this been solved ?

    —
    Reply to this email directly or view it on GitHub
    #8439 (comment).

  10. Carreau commented on Jun 12, 2015

    @Carreau
    Member

    Will investigate this weekend

    No hurry .

  11. j9ac9k commented on Jun 14, 2015

    @j9ac9k
    Author

    I just confirmed the issue still exists:

    [server] 
    $ ipython kernel
    ...
    
    To connect another client to this kernel, use:
       --existing kernel-15047.json
    

    I then retrieve the kernel-15047.json file, and edit the ip address to match the ip address of the server

    [client] 
    $ ipython qtconsole --existing ./kernel-15047.json --ssh hwvmsrv
    c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\client.py:580: UserWarning: U
    nknown ssh-rsa host key for hwvmsrv: b'96b38225fac1d25f1f78ebb913d32f3d'
      (key.get_name(), hostname, hexlify(key.get_fingerprint())))
    [IPythonQtConsoleApp] ERROR | Could not setup tunnels
    Traceback (most recent call last):
      File "c:\Users\ogi\Miniconda3\lib\site-packages\IPython\consoleapp.py", line 2
    39, in init_ssh
        newports = tunnel_to_kernel(info, self.sshserver, self.sshkey)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\IPython\kernel\connect.py", li
    ne 357, in tunnel_to_kernel
        if tunnel.try_passwordless_ssh(sshserver, sshkey):
      File "c:\Users\ogi\Miniconda3\lib\site-packages\zmq\ssh\tunnel.py", line 78, i
    n try_passwordless_ssh
        return f(server, keyfile)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\zmq\ssh\tunnel.py", line 122,
    in _try_passwordless_paramiko
        look_for_keys=True)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\client.py", line 307,
     in connect
        look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\client.py", line 444,
     in _auth
        key = pkey_class.from_private_key_file(key_filename, password)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\pkey.py", line 183, i
    n from_private_key_file
        key = cls(filename=filename, password=password)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\rsakey.py", line 55,
    in __init__
        self._from_private_key_file(filename, password)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\rsakey.py", line 165,
     in _from_private_key_file
        data = self._read_private_key_file('RSA', filename, password)
      File "c:\Users\ogi\Miniconda3\lib\site-packages\paramiko\pkey.py", line 254, i
    n _read_private_key_file
        with open(filename, 'r') as f:
    FileNotFoundError: [Errno 2] No such file or directory: ''
    

    To make sure this was just an ipython issue, I managed to establish connectivity with paramiko through git bash.

    $ ssh ogi@hwvmsrv
    Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-37-generic x86_64)
    
     * Documentation:  https://help.ubuntu.com/
    
      System information as of Sun Jun 14 15:21:25 PDT 2015
    
      System load:  0.75               Processes:           108
      Usage of /:   32.0% of 17.58GB   Users logged in:     1
      Memory usage: 6%                 IP address for eth0: 192.168.1.130
      Swap usage:   0%
    
      Graph this data and manage this system at:
        https://landscape.canonical.com/
    
    *** System restart required ***
    Last login: Sun Jun 14 15:21:26 2015 from 192.168.1.120
    ogi@hwvmsrv:~$
    

    Let me know if there is any testing I can do to be of help.

  12. sdemyanov commented on Jul 28, 2015

    @sdemyanov

    Have the same problem Is there any update on it?
    P.S. the problem was solved by "easy_install pexpect"

  13. added this to the not ipython milestone on Jan 26, 2016
  14. kondor6c commented on Oct 31, 2016

    @kondor6c

    I set out to test this issue and I was able to replicate the issue given similar circumstances. After I had the failure mentioned above, I started ssh tunnels and I was able to connect. Here is a screen shot demonstrating that (due to the graphical nature of Windows), I also have console output below. replicated.

    PS C:\Users\ipython-test> ipython qtconsole --existing C:\Users\ipython-test\Downloads\kernel-31589.json --ssh [email protected] --debug
    [TerminalIPythonApp] WARNING | Subcommand `ipython qtconsole` is deprecated and will be removed in future versions.
    [TerminalIPythonApp] WARNING | You likely want to use `jupyter qtconsole` in the future
    [JupyterQtConsoleApp] Searching ['C:\\Users\\ipython-test', 'C:\\Users\\ipython-test\\.jupyter', 'C:\\Users\\ipython-test\\Anaconda3\\etc\\jupyter', 'C:\\ProgramData\\jupyter'] for config files
    [JupyterQtConsoleApp] Looking for jupyter_config in C:\ProgramData\jupyter
    [JupyterQtConsoleApp] Looking for jupyter_config in C:\Users\ipython-test\Anaconda3\etc\jupyter
    [JupyterQtConsoleApp] Looking for jupyter_config in C:\Users\ipython-test\.jupyter
    [JupyterQtConsoleApp] Looking for jupyter_config in C:\Users\ipython-test
    [JupyterQtConsoleApp] Looking for jupyter_qtconsole_config in C:\ProgramData\jupyter
    [JupyterQtConsoleApp] Looking for jupyter_qtconsole_config in C:\Users\ipython-test\Anaconda3\etc\jupyter
    [JupyterQtConsoleApp] Looking for jupyter_qtconsole_config in C:\Users\ipython-test\.jupyter
    [JupyterQtConsoleApp] Looking for jupyter_qtconsole_config in C:\Users\ipython-test
    [JupyterQtConsoleApp] Connecting to existing kernel: C:\Users\ipython-test\Downloads\kernel-31589.json
    [JupyterQtConsoleApp] Loading connection file C:\Users\ipython-test\Downloads\kernel-31589.json
    [JupyterQtConsoleApp] Loading connection file C:\Users\ipython-test\Downloads\kernel-31589.json
    [JupyterQtConsoleApp] Forwarding connections to 127.0.0.1 via [email protected]
    C:\Users\ipython-test\Anaconda3\lib\site-packages\paramiko\client.py:664: UserWarning: Unknown ssh-rsa host key for 192.168.100.1: b'b41f9b07bad7b17c510b43c61f669f57'
      (key.get_name(), hostname, hexlify(key.get_fingerprint())))
    [JupyterQtConsoleApp] ERROR | Could not setup tunnels
    Traceback (most recent call last):
      File "C:\Users\ipython-test\Anaconda3\lib\site-packages\jupyter_client\consoleapp.py", line 229, in init_ssh
        newports = tunnel_to_kernel(info, self.sshserver, self.sshkey)
      File "C:\Users\ipython-test\Anaconda3\lib\site-packages\jupyter_client\connect.py", line 236, in tunnel_to_kernel
        if tunnel.try_passwordless_ssh(sshserver, sshkey):
      File "C:\Users\ipython-test\Anaconda3\lib\site-packages\zmq\ssh\tunnel.py", line 74, in try_passwordless_ssh
        return f(server, keyfile)
      File "C:\Users\ipython-test\Anaconda3\lib\site-packages\zmq\ssh\tunnel.py", line 118, in _try_passwordless_paramiko
        look_for_keys=True)
      File "C:\Users\ipython-test\Anaconda3\lib\site-packages\paramiko\client.py", line 380, in connect
        look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)
      File "C:\Users\ipython-test\Anaconda3\lib\site-packages\paramiko\client.py", line 524, in _auth
        key = pkey_class.from_private_key_file(key_filename, password)
      File "C:\Users\ipython-test\Anaconda3\lib\site-packages\paramiko\pkey.py", line 196, in from_private_key_file
        key = cls(filename=filename, password=password)
      File "C:\Users\ipython-test\Anaconda3\lib\site-packages\paramiko\rsakey.py", line 45, in __init__
        self._from_private_key_file(filename, password)
      File "C:\Users\ipython-test\Anaconda3\lib\site-packages\paramiko\rsakey.py", line 163, in _from_private_key_file
        data = self._read_private_key_file('RSA', filename, password)
      File "C:\Users\ipython-test\Anaconda3\lib\site-packages\paramiko\pkey.py", line 267, in _read_private_key_file
        with open(filename, 'r') as f:
    FileNotFoundError: [Errno 2] No such file or directory: ''
    [JupyterQtConsoleApp] Exiting application: jupyter-qtconsole
    PS C:\Users\ipython-test> ipython qtconsole --existing C:\Users\ipython-test\Downloads\kernel-31589.json --debug
    [TerminalIPythonApp] WARNING | Subcommand `ipython qtconsole` is deprecated and will be removed in future versions.
    [TerminalIPythonApp] WARNING | You likely want to use `jupyter qtconsole` in the future
    [JupyterQtConsoleApp] Searching ['C:\\Users\\ipython-test', 'C:\\Users\\ipython-test\\.jupyter', 'C:\\Users\\ipython-test\\Anaconda3\\etc\\jupyter', 'C:\\ProgramData\\jupyter'] for config files
    [JupyterQtConsoleApp] Looking for jupyter_config in C:\ProgramData\jupyter
    [JupyterQtConsoleApp] Looking for jupyter_config in C:\Users\ipython-test\Anaconda3\etc\jupyter
    [JupyterQtConsoleApp] Looking for jupyter_config in C:\Users\ipython-test\.jupyter
    [JupyterQtConsoleApp] Looking for jupyter_config in C:\Users\ipython-test
    [JupyterQtConsoleApp] Looking for jupyter_qtconsole_config in C:\ProgramData\jupyter
    [JupyterQtConsoleApp] Looking for jupyter_qtconsole_config in C:\Users\ipython-test\Anaconda3\etc\jupyter
    [JupyterQtConsoleApp] Looking for jupyter_qtconsole_config in C:\Users\ipython-test\.jupyter
    [JupyterQtConsoleApp] Looking for jupyter_qtconsole_config in C:\Users\ipython-test
    [JupyterQtConsoleApp] Connecting to existing kernel: C:\Users\ipython-test\Downloads\kernel-31589.json
    [JupyterQtConsoleApp] Loading connection file C:\Users\ipython-test\Downloads\kernel-31589.json
    [JupyterQtConsoleApp] connecting shell channel to tcp://127.0.0.1:39093
    [JupyterQtConsoleApp] Connecting to: tcp://127.0.0.1:39093
    [JupyterQtConsoleApp] connecting iopub channel to tcp://127.0.0.1:45981
    [JupyterQtConsoleApp] Connecting to: tcp://127.0.0.1:45981
    [JupyterQtConsoleApp] connecting stdin channel to tcp://127.0.0.1:41005
    [JupyterQtConsoleApp] Connecting to: tcp://127.0.0.1:41005
    [JupyterQtConsoleApp] connecting heartbeat channel to tcp://127.0.0.1:49703
    [JupyterQtConsoleApp] Received history reply with 288 entries
    [JupyterQtConsoleApp] Exiting application: jupyter-qtconsole
    PS C:\Users\ipython-test> ipython
    Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)]
    Type "copyright", "credits" or "license" for more information.
    
    IPython 5.1.0 -- An enhanced Interactive Python.
    
  15. menghuu commented on Nov 20, 2017

    @menghuu

    i also have this problems too. except i do not have private/public key. the error output just like yours
    also, i try to connect the remote ipython kernel (client is wsl, server is ubuntu), it gets stuck

    m@DESKTOP-S5CD00M:/mnt/d/my_work/userlocation$ ipython3 console --existing ./kernel-9337.json --ssh [email protected] --debug
    [ZMQTerminalIPythonApp] Config changed:
    [ZMQTerminalIPythonApp] {'ZMQTerminalIPythonApp': {'existing': './kernel-9337.json', 'sshserver': '[email protected]'}, 'Application': {'log_level': 10}}
    [ZMQTerminalIPythonApp] IPYTHONDIR set to: /home/m/.ipython
    [ZMQTerminalIPythonApp] Using existing profile dir: '/home/m/.ipython/profile_default'
    [ZMQTerminalIPythonApp] Searching path ['/mnt/d/my_work/userlocation', '/home/m/.ipython/profile_default'] for config files
    [ZMQTerminalIPythonApp] Attempting to load config file: ipython_config.py
    [ZMQTerminalIPythonApp] Attempting to load config file: ipython_console_config.py
    [ZMQTerminalIPythonApp] Connecting to existing kernel: /mnt/d/my_work/userlocation/kernel-9337.json
    [ZMQTerminalIPythonApp] Loading connection file /mnt/d/my_work/userlocation/kernel-9337.json
    [ZMQTerminalIPythonApp] Loading connection file /mnt/d/my_work/userlocation/kernel-9337.json
    [ZMQTerminalIPythonApp] Forwarding connections to 127.0.0.1 via user@ xx.xx.xx.xx

    anyone can help?

  16. ronald-jaepel commented on Nov 23, 2018

    @ronald-jaepel

    I bumped into the same problem.
    The problem is, as @takluyver mentioned, that the default value for the sshkey value created in "jupyter_client/consoleapp.py" is

    sshkey = Unicode('', config=True, help="""Path to the ssh key to use for logging in to the ssh server.""")
    here
    but paramiko only tests for None to see if no keyfile was specified.

    First I tried manually setting the sshkey value to None from the command line.
    jupyter qtconsole --JupyterQtConsoleApp.sshkey=None --existing etc
    which returned
    [JupyterQtConsoleApp] CRITICAL | The 'sshkey' trait of a JupyterQtConsoleApp instance must be a unicode string, but a value of None <class 'NoneType'> was specified.

    What finally worked, as a quick dirty workaround, was to change the value in the consoleapp.py file (line 122) to default to None. Now things work, but it feels terrible.

    What is your opinion on further steps? Should this be closed and an issue be opened at paramiko to include tests for emtpy strings? That's what I would do.

  17. takluyver commented on Nov 23, 2018

    @takluyver
    Member

    I don't think there's much obvious advantage between making the default None and making paramiko test for empty strings. Given what you've found, I'd be fine with making the default None in jupyter_client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions