tdaff / remote_ikernel

All your Jupyter kernels, on all your machines, in one place.
https://pypi.org/project/remote_ikernel/
BSD 2-Clause "Simplified" License
17 stars 14 forks source link

SSH to non-standard port #23

Closed tdaff closed 7 years ago

tdaff commented 7 years ago

Original report by Anonymous.


I tried to set up remote_ikernel to a server, where sshd listened on a non-standard. Kernel died. Connection established, but then the startup script failed when it tried to set up tunnels. After some digging it looked like, in the first ssh command, the host and port were not splitted. My solution is below:

292,293c292,297
<         login_cmd = 'ssh -o StrictHostKeyChecking=no {args} {host}'.format(
<             args=launch_args, host=self.host)
---
>         if ':' in self.host:
>             login_cmd = 'ssh -p {host_port} -o StrictHostKeyChecking=no {args} {host}'.format(
>                 args=launch_args, host=self.host.split(":")[0], host_port=self.host.split(":")[1])
>         else:
>             login_cmd = 'ssh -o StrictHostKeyChecking=no {args} {host}'.format(
>                 args=launch_args, host=self.host)
tdaff commented 7 years ago

Original comment by Tom Daff (Bitbucket: tdaff, GitHub: tdaff).


Allow host:port for all ssh commands

Fixes #22