Skip to content

Add optional custom SFTP server command setting#3

Open
numbereleven-a wants to merge 2 commits into
wesmar:mainfrom
numbereleven-a:custom-sftp-server-command
Open

Add optional custom SFTP server command setting#3
numbereleven-a wants to merge 2 commits into
wesmar:mainfrom
numbereleven-a:custom-sftp-server-command

Conversation

@numbereleven-a

Copy link
Copy Markdown

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@host

Example setting:

ini sftpservercommand=/usr/lib/sftp-server

The option is also exposed in the connection dialog as:

ext SFTP server command:

SFTP server command field

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@host

can work, while the standard subsystem request fails with:

ext Unable to request SFTP subsystem

This option makes that setup usable without changing behavior for normal servers.

Behavior

  • Default behavior is unchanged.
  • Existing sessions do not need any changes.
  • The custom command is only used when explicitly configured.
  • Normal OpenSSH servers should leave this field empty.
  • Reconnect logic uses the same command when reopening the SFTP channel.

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-server

Testing

Tested with an OpenWrt/Dropbear setup where the standard SFTP subsystem request fails but /usr/lib/sftp-server works when started explicitly.

Also tested:

  • empty field: existing subsystem behavior remains active;
  • valid command: SFTP session starts and directory listing works;
  • invalid command: connection fails as expected;
  • dialog field saves/removes sftpservercommand in sftpplug.ini.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant