Add optional custom SFTP server command setting#3
Open
numbereleven-a wants to merge 2 commits into
Open
Conversation
Allow saved sessions to start SFTP through an explicit server command instead of requesting the standard sftp subsystem. This supports servers where an SFTP binary is available, but the SSH server does not advertise or allow the subsystem request.
Add a connection dialog field for the sftpservercommand setting and persist it alongside the other per-session options.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an optional per-session setting for starting SFTP with a custom server command.
When sftpservercommand is empty, the plugin keeps the current behavior and requests the standard SSH sftp subsystem.
When sftpservercommand is set, the plugin starts SFTP with an SSH �xec request, similar to OpenSSH:
�ash sftp -s /path/to/sftp-server user@hostExample setting:
ini sftpservercommand=/usr/lib/sftp-serverThe option is also exposed in the connection dialog as:
ext SFTP server command:Motivation
Some SSH servers allow login and can run an SFTP server binary manually, but do not expose or allow the standard sftp subsystem request.
One example where this can happen is OpenWrt 25.x with Dropbear. In that setup, a manual command such as:
�ash sftp -s /usr/lib/sftp-server root@hostcan work, while the standard subsystem request fails with:
ext Unable to request SFTP subsystemThis option makes that setup usable without changing behavior for normal servers.
Behavior
Configuration
The value can be configured in the connection dialog or manually in sftpplug.ini:
ini [example] server=192.168.1.1 user=root sftpservercommand=/usr/lib/sftp-serverTesting
Tested with an OpenWrt/Dropbear setup where the standard SFTP subsystem request fails but /usr/lib/sftp-server works when started explicitly.
Also tested: