-
Notifications
You must be signed in to change notification settings - Fork 27
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
Make ssh
work on Windows
#84
Comments
An FYI: The built-in SSH client on Windows 10 v1803 (build 17134.523, 2018-07-10) does not support SSH reverse tunneling. Unfortunately, it looks like Windows 10 v1809 (build 17763.253, 2018-11-13) still doesn't support it properly - although there have been some improvements, socket connections fail over such tunnels. See my https://github.com/HenrikBengtsson/future/issues/244#issuecomment-437568082 for my brief notes on this. UPDATE 2023-02-05: Reverse tunneling works with MS Windows' |
Looks like I could use the PuTTY command-line tool (at the cost of incurring an extra dependency). I'll likely wait until at least some users request this, or the Windows-internal SSH gets fixed. Thanks! |
This could maybe work with Ubuntu for Windows (H/T UCLA QCB) |
Hey, just ran into this issue as well. This would be super useful to have for beginners (dev on Windows RStudio, Q() on linux HPC). Not sure whether I understand where the WSL comes into play here. Let me try to describe the issue in a bit more detail. I am trying to follow the clustermq documentation for connecting to a (remote) slurm cluster for execution using ssh on a Win 10 system from an Rstudio session. The error message I get is
This seems to indicate that clustermq is trying to use the system ssh command for communication. Ofc, ssh is not available by default on all Windows system / prompts. At least it is not on mine. Trying the set the path to the RStudio version (msys) does not work for me either because it then cannot create the .ssh configuration file in the right location (looking in '/home/[xxx]/.ssh' and it seems a bit hackish. Setting a debug marker and stepping through the code, it seems that the issue is indeed caused by relying on the system ssh command, e.g., here: Line 26 in b5a7664
Is there a specific reason not to go through the rOpenSci ssh package instead? I tried to connect to the cluster from the debug location (see above) and I could send a 'hello world' to R fine. Wanted to check back with you before digging deeper into the code, maybe there is a good reason for not using the package. If I see it correctly, we need some port forwarding magic... Otherwise, is there a way to (optionally) use the ssh version installed with RStudio? |
Drive-by "FWIW" comment:
What MS Windows system are you on? AFAIU, |
FYI, I'm not sure if you rely on reverse tunneling, but that works with MS Windows' ssh too if one uses 127.0.0.1 instead of localhost, or if one uses ssh -4, cf. PowerShell/Win32-OpenSSH#1265 (comment). I've successfully made this the default in parallelly since April 2021. |
Win 10 enterprise, org managed and as it seems with the optional openssh feature disabled x) How do you feel about getting rid of the ssh system dependency and using the ssh package instead? Should work across all systems then, right? |
Thank you. I had no idea it was possible to disable it that way. Would you mind sharing exact details of how you navigate to that setting? That could be very useful for other Windows users experiencing similar problems, i.e. would be part of the first troubleshooting instructions to find out of SSH has been disabled.
I'm not the maintainer of clustermq, but I'm the author of parallelly, which, like clustermq and base-R package parallel, rely on system calls to Regarding using the ssh package instead: Personally, I would not switch out the existing solution has a long track record (here and in parallelly), because (i) you don't want to break something that works, and (ii) you never know what new problems are introduced. For example, on Linux, the ssh package, depends on the openssl package, and together they require system library Instead, I think using ssh as an alternative would be the best approach. FWIW, one thing I noticed when I looked at ssh was that I'm not sure if it currently supports reverse SSH tunneling. That's at least a quite essential feature of the parallelly package. (*) I just tried on a fresh Ubuntu 22.04 setup and I got the below errors:
|
Great points, offering a fallback or documenting a reasonably stable workaround might be the better way to go. The official docs on enabling openssh for Windows 10 are: https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui Looking at Lines 1 to 7 in 68c03c8
it seems that reverse tunnelling might be required. I do not know whether the ssh package supports this, tagging @jeroen. Would be great if we could use the ssh package as fallback on Windows. |
If possible.
This could use the Linux subsystem in newer versions (Win>=10 IIRC)
Update: Powershell now includes SSH by default (or needs to be activated?) on Win10
https://github.com/PowerShell/openssh-portable
https://poweruser.blog/enabling-the-hidden-openssh-server-in-windows-10-fall-creators-update-1709-and-why-its-great-51c9d06db8df
The text was updated successfully, but these errors were encountered: