adamyg / mcwin32

Midnight Commander for Windows
https://sourceforge.net/projects/mcwin32/
204 stars 13 forks source link

Windows 10 OpenSSH integration #1

Closed eugenov closed 2 years ago

eugenov commented 3 years ago

Hello! Is there any way to integrate mc with windows 10 built-in Openssh? SFTP feature is not so usable at moment, but with ~/.ssh/config reading will open all the doors: public key auth, jumphosts, etc.

adamyg commented 3 years ago

mc is based on libssh2, whereas the window implementation is PowerShell/openssh-portable, direct integration is not feasible. Use of the OpenSSH ssh-agent may be a possible solution, which from initial research shall utilize the local certstore.

adamyg commented 3 years ago

On further investigation to my surprise Win-OpenSSH seems to use local registry entries. I can not find any CertStore interaction within either the client nor the agent. Regardless the Win-OpenSSH agent uses a named pipe for ipc, libssh2 would need enhancing to support (libssh2/src/agent.c)

PuTTY's Pageantis is already supported by libssh2, suggest this the most suitable solution at this time.

adamyg commented 3 years ago

libssh2 OpenSSH support is in the pipeline, https://github.com/libssh2/libssh2/pull/517

eugenov commented 3 years ago

Since libssh2 will grab ~.ssh\config, for user it will be no difference: openssh or libssh2 somewhere inside, imao

eugenov commented 3 years ago

Hello! Do you have any roadmap? TY!

adamyg commented 3 years ago

Waiting on the next libssh2 release.

eugenov commented 3 years ago

[libssh2] Update to 1.10.0 microsoft/vcpkg#20364

adamyg commented 2 years ago

libssh2-1.10, target build-221

eugenov commented 2 years ago

Is there any plans to migrate to libssh? It offers more openssh compatibility, and maintained by RedHat, as far as i know. In fact, now everithing works pretty well, just curious

Neustradamus commented 1 year ago

@eugenov: @adamyg has done a new version, can you look?

eugenov commented 1 year ago

@Neustradamus Just checked - mc respects ~.ssh\config file. It also works with Openssh agent. Perfect

eugenov commented 1 year ago

But only for FISH, SFTP not supported image

adamyg commented 1 year ago

SFTP utilizes libssh2.

eugenov commented 1 year ago

@adamyg and FISH - Openssh? Didn't get it. libssh2 bundled with mc, right? Openssh does not. Why FISH works but SFTP does not?

adamyg commented 1 year ago

vfs/sftp connections are via libssh2, whereas Files transferred over Shell protocol (FISH) over SSH, an ssh client is required, you can either install Win32-OpenSSH or WinXSH. For legacy RSH based connections WinXSH is needed.