ssh2 icon indicating copy to clipboard operation
ssh2 copied to clipboard

Feature Request: Allow setting custom subsystem with sftp

Open cinderblock opened this issue 2 years ago • 2 comments

On Linux systems, the SFTP client sftp has the -s option which enables certain features on the remote system.
Most notably, running sftp-server with sudo.

I'm not seeing a way to do that here. Would is be possible to add this feature?

Buried in the docs here, I see what looks like it could be some partial support for this, but maybe that is part of the Server documentation.

cinderblock avatar Apr 20 '23 20:04 cinderblock

+1 Also extremely interested in this.

I checked the code and found no references of any /usr/bin/sftp-server (and similar known paths). Maybe this could be done with some tweaking, the call to client.sftp(cb) is requesting the default 'sftp' subsystem, maybe (not verified yet) the call to reqSubsystem could make use of a path instead of the sftp subsystem identifier.

Will try to hack this over the weekend. If it works would just be a matter of allowing the subsystem to be sent as an argument,, like client.sftp(cb, { subsystem }).

joaomariord avatar May 11 '23 15:05 joaomariord

Made a PR (#1296) on this, let's see how far it goes 😄

joaomariord avatar May 12 '23 12:05 joaomariord