New SFTP plugin available now

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: New SFTP plugin available now

Post by *JOUBE »

Maybe try just enter the openssh agent in a pageant.lnk (in the plugin folder)?
gpant
Junior Member
Junior Member
Posts: 21
Joined: 2006-11-19, 19:58 UTC
Location: Athens, Greece
Contact:

Re: New SFTP plugin available now

Post by *gpant »

JOUBE wrote: 2024-01-13, 15:49 UTC Maybe try just enter the openssh agent in a pageant.lnk (in the plugin folder)?
I am sorry I don't understand what you mean exactly ?
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: New SFTP plugin available now

Post by *JOUBE »

sftpplug.rc:

Code: Select all

    IDS_AGENT_CONNECTERROR  "Failure connecting to ssh-agent (Pageant)!\nYou can put a link file named pageant.lnk in the plugin directory to launch pageant, e.g. pointing to\nc:\\path\\pageant.exe keyfilename"
gpant
Junior Member
Junior Member
Posts: 21
Joined: 2006-11-19, 19:58 UTC
Location: Athens, Greece
Contact:

Re: New SFTP plugin available now

Post by *gpant »

JOUBE wrote: 2024-01-13, 18:40 UTC sftpplug.rc:

Code: Select all

    IDS_AGENT_CONNECTERROR  "Failure connecting to ssh-agent (Pageant)!\nYou can put a link file named pageant.lnk in the plugin directory to launch pageant, e.g. pointing to\nc:\\path\\pageant.exe keyfilename"
An ssh agent is a service listening to a local socket for requests over a specific protocol (defined here https://datatracker.ietf.org/doc/html/draft-miller-ssh-agent-11), you cant just replace pageant with it.

You can use clients to interact with it, for example you could use the ssh-add.exe tool to inquire for keys as well as add keys to the agent etc, but that would still not help the integration with TC :)

Edit: A nice explanation here: https://smallstep.com/blog/ssh-agent-explained/
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: New SFTP plugin available now

Post by *JOUBE »

gpant wrote: 2024-01-13, 20:06 UTC An ssh agent is a service listening to a local socket for requests over a specific protocol
Yes. You can substitute Pageant with Openssh agent. And Tc uses the standard requests of the lib.
gpant
Junior Member
Junior Member
Posts: 21
Joined: 2006-11-19, 19:58 UTC
Location: Athens, Greece
Contact:

Re: New SFTP plugin available now

Post by *gpant »

Ok after checking how pageant works they use the same protocol, I will check tomorrow if I can sign a message successfully by just replacing the pipe from the ssh-agent to the pageant one on a test app, if that works then it would be as easy as TC checking the sshd_config for the pipe used by the agent and using that.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New SFTP plugin available now

Post by *ghisler(Author) »

My plugin uses libssh2_agent_init to create the Agent object, and then libssh2_agent_connect to connect to it. According to "supported_backends" in agent.c it supports the backends Pageant, OpenSSH and Unix. So in principle it should work with the OpenSSH backend...
Author of Total Commander
https://www.ghisler.com
gpant
Junior Member
Junior Member
Posts: 21
Joined: 2006-11-19, 19:58 UTC
Location: Athens, Greece
Contact:

Re: New SFTP plugin available now

Post by *gpant »

Ok, so since libssh2 1.10.0, will read the env and use the windows pipe of openssh-agent instead of trying to access the pageant af_unix socket ! it works as long as you dont have a borked env variable. So it does work as it should.
No change needed other than the checkbox string to either include openssh or just rename to "Use ssh-Agent" :)
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: New SFTP plugin available now

Post by *JOUBE »

gpant wrote: 2024-01-14, 19:22 UTCSo it does work as it should. No change needed ...
As I said:
JOUBE wrote: 2024-01-13, 20:18 UTCYes. You can substitute Pageant with Openssh agent. And Tc uses the standard requests of the lib.
and
gpant wrote: 2024-01-14, 19:22 UTC... other than the checkbox string to either include openssh or just rename to "Use ssh-Agent" :)
... really a minor issue, for which microsoft windows needed 20 years to implement it.

Joube
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: New SFTP plugin available now

Post by *JOUBE »

JOUBE wrote: 2024-01-16, 11:26 UTC
ghisler(Author) wrote: 2024-01-16, 10:08 UTClargefilesupport=1
Interesting.
This is apparently an option with/of libssh2. Could you please document this and all other options from sftpplug.ini, because I didn't find anything about it in this Tc-forum or in the SFTP-plugin. For example - the easiest way - is within the readme.txt, that comes with the plugin.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New SFTP plugin available now

Post by *ghisler(Author) »

No, it's a plugin option. You can find the implementation in the sources of my plugin. In short, it sends the shell command
file `which scp`
and receives a reply like this:

Code: Select all

/usr/bin/scp: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xf079a239b6c061e8213eb39609a13240dbf5f333, stripped
or this:

Code: Select all

/usr/bin/scp: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=a83ad5fb43e27b41a78575121e25f6ba382b6104, stripped
In my tests, only the 64-bit version was reliably capable of handling files >2GB. Maybe it was changed in a newer version of scp, but TC warns the user when 64-bit isn't reported.

You can send the command
file `which scp`
yourself via the Total Commander command line to the plugin. Double click on the 2 line command history to be able to copy the result.
Author of Total Commander
https://www.ghisler.com
CoolWater
Power Member
Power Member
Posts: 737
Joined: 2003-03-27, 16:33 UTC

Re: New SFTP plugin available now

Post by *CoolWater »

I made some further tests and did some research. Unfortunately libssh2 seems to be the slowest of all open-source SSH/SFTP/SCP implementations.

Libssh, FileZilla and WinSCP are way faster than libssh2. FileZilla and WinSCP are Putty-based.

The only downside of using libssh would be that it doesn't support WinCNG (Windows crypto API).

Here is a comparison between libssh and libssh2:
https://libssh2.org/libssh2-vs-libssh.html

Side-fact: According to OpenSSH developers in April 2019, SCP is outdated, inflexible and not readily fixed; they recommend the use of more modern protocols like SFTP and rsync for file transfer.

Maybe supporting rsync would be a good option to be implemented.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New SFTP plugin available now

Post by *ghisler(Author) »

There is a third party Putty based plugin:
https://totalcmd.net/plugring/sftp4tc.html
Unfortunately it hasn't been updated since 2017.
Author of Total Commander
https://www.ghisler.com
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: New SFTP plugin available now

Post by *JOUBE »

CoolWater wrote: 2024-01-04, 18:13 UTC For testing, I made some changes concerning the buffer sizes. They are now dynamically calculated. Here are my results:
Download speed before:
SFTP: ~7.7 MB/s
Download speed with dynamic buffers:
SFTP: ~20 MB/s

Upload speed before:
SFTP: ~2.7 MB/s
Upload speed with dynamic buffers:
SFTP: ~5.3 MB/s
CoolWater wrote: 2024-01-18, 12:45 UTC I made some further tests and did some research. Unfortunately libssh2 seems to be the slowest of all open-source SSH/SFTP/SCP implementations.
@ghisler(author)
As Coolwater writes in his tests, dynamic buffers speed up uploads/downloads. So don't worry about what others say about libssh2 and what might be true. Please implement dynamic buffer to speed up the plugin 3 times now. That's enough for now.

Thanks in advance and best regards

Joube
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New SFTP plugin available now

Post by *ghisler(Author) »

He sent me his changes but there are several problems with them which need to be addressed first:
- crashes in text mode
- strange choice of buffer size, seems to converge to 32 seconds(!) per buffer with no upper buffer size limit
- use of goto commands, a no-go according to all teachers. :roll:
Author of Total Commander
https://www.ghisler.com
Post Reply