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

Exception before prompting for password during ssh connection #1824

Closed
amir-f opened this issue Jun 1, 2012 · 0 comments · Fixed by #4346
Closed

Exception before prompting for password during ssh connection #1824

amir-f opened this issue Jun 1, 2012 · 0 comments · Fixed by #4346

Comments

@amir-f
Copy link

amir-f commented Jun 1, 2012

Setup

Win 7 x64

ipython==0.12.1
paramiko==1.7.7.2
pyzmq==2.2.0

Issue

I want to connect an IPython qtconsole on Windows to an IPython kernel on a remote linux box through ssh2.

I made the following changes in ipython_qtconsole_config.py:

#### Path to the ssh key to use for logging in to the ssh server.
import os
c.IPythonQtConsoleApp.sshkey = os.path.expanduser('~')+'\\.ssh\\id_dsa'

When I run
ipython qtconsole --IPythonQtConsoleApp.sshserver='user@hostname' --existing kernel-21449.json

I receive:

[IPythonQtConsoleApp] Could not setup tunnels
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\IPython\frontend\consoleapp.py", line 289, in init_ssh
    newports = tunnel_to_kernel(info, self.sshserver, self.sshkey)
  File "C:\Python27\lib\site-packages\IPython\lib\kernel.py", line 248, in tunnel_to_kernel
    password = getpass("SSH Password for %s: "%sshserver)
  File "C:\Python27\lib\getpass.py", line 95, in win_getpass
    msvcrt.putch(c)
TypeError: must be char, not unicode

For now, I edited IPython/lib/kernel.py:248 as a temporary workaround in the following way:

password = getpass("SSH Password for %s: "%sshserver.encode('ascii','ignore'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant