SFTPplug Help

Comprehensive manual for Total Commander SFTP/SCP/Shell/PHP Agent/LAN Pair/Jump Host plugin.

Scope: This help covers the complete plugin functionality: SSH authentication (password, public key, Pageant), SFTP/SCP transfer modes, shell fallback for blocked hosts, PHP Agent for HTTP-based file operations, LAN Pair, Jump Host (ProxyJump), proxy configuration, session management, and advanced troubleshooting.

Main Sections

Getting Started

Authentication & Security

Transfer Methods

Configuration

Support

Keyboard Shortcuts (Connection List)

  • F7 - Create new connection session
  • F8 / Del - Delete selected session
  • Enter - Connect with current settings
  • Alt+Enter - Edit selected session options
  • Escape - Cancel connection attempt

Feature Highlights

SSH/SFTP/SCP

  • Full SFTP protocol support with resume capability
  • SCP transfer mode (including SCP-only for restrictive hosts)
  • Mixed mode: SFTP listing + SCP transfers
  • Native PPK key support (v2 and v3 with OpenSSL 4.1.0 Argon2id)
  • Custom sftp-server command for OpenWrt and non-standard hosts
  • Batch download error prompt (Skip / Skip all / Cancel) across 16 languages
  • Pageant integration for key management
  • Proxy support: HTTP CONNECT, SOCKS4a, SOCKS5
  • SSH Jump Host / ProxyJump through bastion servers

Shell Fallback

  • Works when SFTP/SCP are blocked by server policy
  • Multiple methods: raw cat, dd blocks, base64 encoding
  • Automatic resume with proper alignment
  • Command escaping for special characters
  • Compatible with minimal shell environments

PHP Agent (HTTP)

  • No SSH account needed - works with web hosting
  • Password authentication; only a salted hash is stored on the server (use HTTPS)
  • Full file operations: CRUD + rename + hash
  • Chunked upload with resume support
  • Auto chunk from PROBE recommendation (safe clamp + fallback)
  • Capability probing before operations
  • TAR stream mode: whole-directory download (TAR_STREAM) and batch upload (TAR_EXTRACT) in one HTTP request
  • Configurable upload method (Auto/POST/PUT) and chunk size (Auto/2–64 MiB)
  • Shell execution via HTTP (when enabled)

Character Encoding

  • UTF-8 auto-detection for international filenames
  • Multiple codepage support (1250-1258, Asian, etc.)
  • Text/binary/auto transfer modes
  • Line ending conversion (CRLF/LF)
  • UTF-8 BOM preservation

LAN Pair & Jump Host

  • LAN Pair for direct Windows-to-Windows pairing
  • Role-based pairing: Auto / Receiver / Donor
  • Per-session LAN Pair timeout with persistent INI storage
  • Jump Host / ProxyJump using SSH direct-tcpip without external ssh.exe
  • Separate fingerprint and authentication state for jump host and target host

Session Management & Import

  • Unlimited saved sessions
  • Encrypted password storage (Windows DPAPI)
  • Sessions from SecureCRT, PuTTY, WinSCP, FileZilla and KiTTY listed in the [Imports] folder
  • Connect straight from the imports folder, or copy sessions into your own list with F5
  • KiTTY and FileZilla passwords carried over when the source has one saved
  • Native PPK conversion (v2, v3/Argon2 and ed25519, no external tools)
  • Proxy settings per session

Localization

  • 15 languages: EN, PL, DE, FR, ES, IT, RU, CS, HU, NL, PT-BR, RO, SK, UK, JA, ZH-CN
  • External .lng files loaded at runtime — no rebuild needed
  • Auto-detected from Total Commander wincmd.ini
  • Dynamic dialog layout adjusts for label length in all languages

Quick Reference

Transfer Mode Selection

  1. Start with SSH (SFTP/SCP) - works for most servers
  2. If SFTP fails: try Use SCP for data transfers
  3. If SCP fails: try Use SCP for everything
  4. If still failing: enable Shell transfer fallback
  5. No SSH access: use PHP Agent (HTTP)
  6. Need bastion access to SSH target: use Jump Host
  7. Need direct Windows-to-Windows local transfer: use LAN Pair

Authentication Selection

  1. Have SSH key? Use Private key file (PEM or PPK)
  2. Using Pageant? Check Use SSH agent
  3. Only password? Enter in Password field
  4. Hosting without SSH? Use PHP Agent mode

Common Ports

  • SSH/SFTP: 22 (default), often custom (2222, etc.)
  • HTTP: 80
  • HTTPS: 443
  • SOCKS proxy: 1080
  • HTTP proxy: 8080
Practical tip: If the host blocks SFTP/SCP, this plugin can still transfer files via shell command pipeline (cat/dd/base64) where typical tools often fail.

About This Plugin

SFTPplug is a Total Commander filesystem plugin providing secure file transfer over SSH (SFTP, SCP), HTTP (PHP Agent), and direct local pairing (LAN Pair). It features comprehensive authentication support, Jump Host / ProxyJump for bastion-based access, shell fallback for restrictive hosts, PHP-based agent mode for web hosting environments, session import from PuTTY / WinSCP / KiTTY Portable, and runtime localization in 15 languages (PL/DE/FR/ES/IT/RU/CS/HU/NL/PT-BR/RO/SK/UK/JA/ZH-CN).

Version Information

  • Plugin version: Displayed in the connection dialog title bar and the help window title
  • libssh2 version: Displayed in connection log
  • PHP Agent version: 1.0.1

Quick Start

  1. Open connection dialog and enter host/URL.
  2. Set username and authentication (password or key).
  3. Choose transfer mode based on host capabilities.
  4. Save named session and connect.

Three common scenarios

A) Normal SSH server

  • Transfer mode: SSH default.
  • Optional: Pageant or PEM/PPK key.

B) Restricted SSH host (SFTP/SCP issues)

  • Start with SCP-for-data, then SCP-only if needed.
  • Enable shell transfer fallback for stubborn hosts.

C) Hosting without SSH account

  • Use PHP Agent (HTTP).
  • Upload generated sftp.php and connect by URL.

D) SSH server only reachable through bastion

  • Keep transfer mode as SSH (SFTP/SCP).
  • Enable Use jump host and configure the bastion in Jump....
  • Authenticate to jump host and target host independently.

E) Two Windows machines on the same LAN

  • Use LAN Pair.
  • Choose Auto, Receiver, or Donor.
  • Click Pair... and confirm the role when the peer is found.

Back to index

Settings Reference

Main Connection Dialog

The main dialog is accessed via Net Connect (Ctrl+F1) in Total Commander. It contains all connection and transfer settings.

Connection Section

  • Connect to:
    • For SSH/SFTP: Enter hostname (e.g., example.com) or IP address
    • For PHP Agent/Shell: Enter full URL (e.g., https://example.com/sftp.php)
    • Supports custom ports: host:2222 or https://host:8443/sftp.php
    • IPv6 support: [::1]:22
  • Session: The name this session is saved under. Typing a different name renames it when you press OK. Sessions themselves are created with F7 and removed with F8/Delete in the plugin panel.
  • User name: SSH username (for SSH modes); optional label in PHP modes (not used for PHP auth)
  • Password:
    • SSH password authentication
    • PHP Agent shared secret, sent with every request (use HTTPS)
    • Stored encrypted via Windows DPAPI when "Save password" is used

Authentication Section

  • Use SSH agent (Pageant):
    • Automatically tries keys loaded in Pageant
    • Non-intrusive: falls back to other methods if no suitable key
    • Shows detailed log of which keys were tried
  • Certificate: Optional. An OpenSSH certificate (*-cert.pub) signed for the private key, for servers that log users in by certificate. Leave it empty otherwise: the public half of the key is derived from the private key file. A private key entered here by mistake is still used to log in.
  • Private key file:
    • Accepts PEM format (OpenSSH)
    • Accepts PPK format (PuTTY) — native conversion, no external tool or DLL needed
    • Supports encrypted keys with passphrase prompt
    • PPK v2 and PPK v3 (Argon2) both supported natively — Argon2 is built into the plugin

Transfer Mode Section

  • Transfer mode dropdown:
    • SSH (SFTP/SCP) - Standard SSH file transfer
    • Use SCP for data transfers (checkbox) - SFTP for listing, SCP for transfers
    • Use SCP for everything (no SFTP) (checkbox) - Pure SCP mode
    • Use shell transfer (for blocked hosts) (checkbox) - Shell command pipeline
    • PHP Agent (HTTP) - HTTP-based file operations
    • PHP Shell (HTTP) - HTTP pseudo-terminal
    • LAN Pair - direct Windows-to-Windows pairing
  • TAR stream (checkbox, PHP Agent / PHP Shell modes only): when checked, directory downloads use a single TAR_STREAM GET request and batch uploads use a single TAR_EXTRACT POST instead of per-file requests. Greatly reduces round-trip overhead for many small files.
  • Method (PHP Agent / PHP Shell modes only): HTTP verb for single-file uploads — Auto (POST→PUT fallback), POST, or PUT.
  • Chunks (PHP Agent / PHP Shell modes only): upload chunk size — Auto (from server PROBE, 1–64 MiB), or fixed 2 / 4 / 8 / 16 / 32 / 64 MiB.
  • Compress data with ZLIB: Enable SSH compression (may help on slow links)
  • Use shell transfer (for blocked hosts):
    • Enables cat/dd/base64 pipeline fallback
    • Use when SCP/SFTP are blocked by server policy
    • Supports resume with base64 alignment (3-byte boundaries)

Jump Host

  • Use jump host: Enables ProxyJump / bastion routing for SSH mode
  • Jump... Opens dedicated Jump Host configuration dialog
  • Jump Host settings are only active for SSH (SFTP/SCP)
  • Jump Host is disabled for PHP Agent, PHP Shell, and LAN Pair modes

LAN Pair Controls

  • Role: Auto / Receiver / Donor — controls which side initiates the connection; see LAN Pair for details
  • Peer: Detected LAN peer dropdown
  • Session timeout: Minutes; 0 means no limit
  • Trusted Installer (checkbox): When checked, the local LAN Pair file server impersonates the TrustedInstaller account when serving incoming connections. This allows a remote peer to read and write files that are owned by TrustedInstaller (Windows system files, Windows Update directories, etc.) on this machine. Requires that the process has SeDebugPrivilege; Total Commander normally runs with sufficient privileges. See LAN Pair → TrustedInstaller for a full explanation.
  • Pair... Starts pairing or role negotiation

Plugin-wide Configuration (sftpplug.ini)

Plugin-wide settings (language override, etc.) are stored in the [Configuration] section of sftpplug.ini. See the dedicated page for the file location, all available keys, and examples including custom translation files:

→ Plugin Configuration (sftpplug.ini)

Advanced Options

  • Detailed log: Enable verbose logging; output appears in the TC log window (F5 log pane or separate log window)
  • Log full directory listings (debug): Writes every line the server sends for a directory listing into Total Commander's log window — the ls -la output in SCP mode, the server's long entries in SFTP mode. Useful when a listing shows wrong names, dates or permissions: the raw lines show what the plugin was given.

Permissions, Owner and Group

The plugin offers custom columns for remote files:

  • permissions — as ls writes them, e.g. rwxr-xr-x, with s/t for setuid, setgid and sticky
  • octal — the same as a number, e.g. 0755
  • owner and group — names; a server that sends no names shows the numeric ids
  • link target — where a symbolic link points

Total Commander picks up a default view for the plugin on its own: size, date, permissions, owner and group. Other combinations are set up under Configuration → Custom columns, file system Secure FTP. The values come from the directory listing in SFTP and SCP mode; PHP Agent and LAN Pair leave the columns empty.

Alt+Enter on a remote file opens its properties: path, link target, owner, group, permissions, size and date as the listing gave them, and below that the reply of stat run on the server. A server without a shell shows what the SFTP protocol reports instead. The window is for viewing only.

To change permissions, use Files → Change Attributes (Alt+A) on one or more remote files. Over SFTP the mode is set through the protocol, which also works on servers without a shell; in SCP mode the plugin runs chmod. Owner and group cannot be changed from the plugin.

Character Encoding

  • UTF-8 for filenames:
    • Auto-detect: Plugin tries to detect server encoding
    • Force UTF-8: Always use UTF-8 encoding
    • Force ANSI: Use system codepage
  • Text file types: Wildcard patterns for text mode transfers (e.g., *.txt;*.log;*.ini)
  • Transfer mode:
    • Binary: Raw byte transfer (default)
    • ASCII: Convert line endings (CRLF ? LF)
    • Auto: Use wildcard patterns to decide

Proxy Configuration Dialog

Accessed via Proxy... button. Configure network proxy for SSH connections.

Proxy Types

  • No proxy: Direct connection
  • HTTP CONNECT: HTTP proxy using CONNECT method
  • SOCKS4a: SOCKS version 4a (supports domain names)
  • SOCKS5: SOCKS version 5 (full authentication support)

Proxy Settings

  • Proxy server: Hostname or IP, optional port (proxy:1080)
  • Username: Proxy authentication username
  • Password: Proxy authentication password (stored encrypted)

Proxy Error Messages

  • Connection not allowed - Proxy policy blocks destination
  • Network unreachable - Target network not reachable via proxy
  • Host unreachable - Specific host not reachable
  • Connection refused - Target actively refused connection
  • TTL expired - Routing loop or timeout
  • Command not supported - Proxy doesn't support requested operation
  • Address type not supported - IPv6/hostname not supported by proxy

Keyboard Shortcuts (Connection Dialog)

  • F7 - Create new session (opens "New folder" dialog for naming)
  • F8 / Delete - Delete selected session
  • Enter - Connect with current settings
  • Alt+Enter - Edit selected session properties

Session Storage

  • Sessions stored in sftpplug.ini in Total Commander directory
  • Passwords encrypted with Windows DPAPI (user-specific)
  • Sessions from SecureCRT, PuTTY, WinSCP, FileZilla and KiTTY appear in the [Imports] folder in the plugin root
  • Cached session lists live next to sftpplug.ini, so imported entries are available right after Total Commander starts
  • Custom locations added through [Add custom location...] are stored per source in sftpplug.ini
Tip: After importing from WinSCP, verify transfer mode settings — SCP sessions arrive with scponly=1 and scpfordata=1. Proxy definitions are not imported from any source and have to be set up again. See Import sessions from other programs.

Back to index

Transfer Modes

1) SSH (SFTP/SCP)

Use first when regular SSH access works. Best default for most servers.

2) Use SCP for data transfers

Use when listing via SFTP works, but upload/download over SFTP is unstable.

3) Use SCP for everything (no SFTP)

Use when SFTP subsystem is blocked or broken, but SCP command path is available.

4) Use shell transfer (for blocked hosts)

Use when even SCP is problematic. Plugin can switch to shell stream/chunk strategies.

5) PHP Agent (HTTP)

Use when no shell/SSH account is available. Requires uploaded sftp.php.

6) PHP Shell (HTTP)

Use for command execution and maintenance through HTTP pseudo-terminal.

7) LAN Pair

Use for direct Windows-to-Windows pairing on the local network. This mode does not use SSH, PHP, or the system SMB stack.

Select Auto role and click Pair... to start the guided 60-second pairing wizard — the plugin listens in the background and prompts for a role when the peer is found. See LAN Pair for full details.

Jump Host note

Jump Host / ProxyJump is not a separate transfer mode. It is an SSH transport extension for the standard SSH (SFTP/SCP) mode when the target host is reachable only through a bastion server.

Fast practical selection

  1. Start with SSH default.
  2. If transfer fails: enable SCP for data.
  3. If still failing: SCP only.
  4. If host blocks channels: shell transfer fallback.
  5. If SSH unavailable: PHP Agent/PHP Shell.
  6. If target SSH is behind a bastion: keep SSH mode and enable Jump Host.
  7. If you need local Windows-to-Windows pairing: use LAN Pair.

Back to index

LAN Pair

LAN Pair is a Windows-to-Windows transfer mode for direct local-network pairing without relying on the system SMB stack. It is designed for practical file exchange between trusted machines on the same network.

What LAN Pair is for

  • Quick transfer between two Windows machines on the same LAN
  • Cases where classic SMB pairing is inconvenient or blocked by local policy
  • Direct plugin-managed sessions inside Total Commander

What it is not

  • It is not classic Windows file sharing
  • It does not enumerate normal SMB shares
  • It is not routed through SSH, SFTP, PHP Agent, or PHP Shell

Discovery and network ports

LAN Pair uses two ports:

PortProtocolPurpose
45845UDP (broadcast)Peer discovery — both machines announce themselves on the local network every 2 seconds
45846TCPPairing handshake and file transfer session

Both ports must be open in Windows Firewall on both machines. If peers do not appear in the discovery list, this is the first thing to check.

Firewall tip: UDP broadcast (port 45845) is blocked between network segments and VLANs by default. LAN Pair discovery works reliably only within the same broadcast domain (same subnet/switch). If your machines are on different VLANs, peers will not be found via auto-discovery.

Password, pairing and encryption

The two computers are paired with a password, the same one on both. It never crosses the network:

  1. Pairing: enter the password on both computers. Each turns it into a pair key (PBKDF2-HMAC-SHA256, 120,000 iterations), and the two prove to each other that they hold the same key with SPAKE2 (RFC 9382). Someone listening learns nothing to guess the password with; someone joining in gets one guess per connection.
  2. Once both sides have proved the key, each stores it encrypted with Windows DPAPI, for that peer.
  3. Later sessions: the stored key is used, so the password field may stay empty.

Everything after the handshake — listings, file names, file contents — travels encrypted and authenticated with AES-256-GCM. A packet altered, repeated or reordered on the way ends the connection instead of reaching a file.

Both computers need version 10.3.1 or later. Earlier versions used a protocol without encryption that let a computer with no key ask for one; a 10.3.1 computer tells an older one to upgrade instead of letting it in. Pairing without a password is no longer possible.

Roles

  • Auto — guided 60-second pairing wizard; the plugin starts the local file server in the background and waits up to 60 seconds for a peer to appear, then prompts you to connect or stay as server.
  • Donor — runs the local LAN Pair file server and waits for an incoming Receiver connection. Does not initiate outgoing connections — the other machine (configured as Receiver) must connect first. Use this on the machine whose files you want to access remotely.
  • Receiver — connects to the Donor's file server. Does not start a local file server. Use this on the machine that will browse and transfer files from the Donor.
Which role for which machine? The Donor is the machine that has the files — it runs as server and waits. The Receiver is the machine that connects and browses — it acts as client. Both machines must be running Total Commander with the plugin installed.

Auto mode — pairing wizard

When Auto is selected and you click Pair..., the plugin runs a guided wizard:

  1. The local file server starts listening on TCP 45846 in the background.
  2. A 60-second countdown dialog appears: "Searching for LAN Pair peer on local network...". You can cancel at any time.
  3. As soon as the other machine is detected, the dialog closes and a prompt appears:
    • Yes — connect to the discovered peer immediately (this machine acts as client / Receiver).
    • No — stay in server / Donor mode; the local file server keeps running.
    • Cancel — stop the local server and cancel.
  4. If no peer appears within 60 seconds, the local server is stopped automatically and a status message is shown. No ports are left open.
Tip: Both machines should click Pair... at roughly the same time. With a 60-second window and a 2-second broadcast interval, there is no need to rush.

Basic workflow

  1. Create or edit a session and set Transfer = LAN Pair.
  2. Set the session name. This name is also shown as the visible peer label on the other machine.
  3. Choose Auto, Receiver, or Donor in the role dropdown.
  4. Optional: set Session timeout in minutes. 0 means no limit.
  5. Click Pair....
  6. Enter the pairing password — the same on both computers. Pairing does not start without one.
  7. When the peer is found and roles are confirmed, the session opens as a regular TC file panel.

TrustedInstaller — accessing protected system files

Windows protects certain system files and directories by assigning them to the TrustedInstaller service account (e.g. files in C:\Windows\, C:\Program Files\WindowsApps\, Windows Update caches). Even an Administrator account cannot modify these files directly without taking ownership. The Trusted Installer checkbox in the LAN Pair connection settings lets you work around this restriction for incoming connections.

How it works

  1. When a remote peer connects to the local LAN Pair file server and the handshake succeeds, the server thread impersonates the TrustedInstaller service account before handling any commands. The handshake itself runs as you, since your DPAPI holds the pair keys.
  2. While impersonating TrustedInstaller, all file operations (read, write, delete, rename, mkdir) run with TrustedInstaller privileges, bypassing the normal ownership restrictions.
  3. Impersonation is reverted automatically when the remote peer disconnects.

The Trusted Installer checkbox has two independent effects depending on which role this machine plays:

  • As Donor (file server): incoming connections from a Receiver are served under TI impersonation — the Receiver can read, write, delete, and rename TI-owned files on this machine.
  • As Receiver (file client): outgoing file transfers run under TI impersonation on this machine — you can download files to TI-protected local directories and upload files from TI-protected local paths.

To work with TI-protected files on the remote machine (the Donor), the checkbox must be enabled on the Donor's connection profile, not the Receiver's.

Requirements

  • The process hosting the plugin (Total Commander) must be running with SeDebugPrivilege. TC normally has this privilege when run as Administrator or with the standard elevated token.
  • The TrustedInstaller Windows service must be startable. The plugin starts it automatically if it is not already running.
  • The setting takes effect immediately on the next incoming connection — no TC restart needed after enabling or disabling the checkbox.
Security note: TrustedInstaller impersonation grants write access to core Windows system files. Enable this option only on machines you fully control and only while you actually need it.

Session timeout

  • 0 = no timeout
  • >0 = session timeout in minutes, measured from the last operation
  • The timeout is stored per session as lanpairtimeout in sftpplug.ini
  • Timeout is checked before each operation; active file transfers are not interrupted mid-stream

Saved settings

LAN Pair session keys in sftpplug.ini:

KeyValuesDescription
transfermode3Fixed value for LAN Pair mode
serverlanpair://peer/PEERNAMEPeer identifier URI
lanpairrole0 / 1 / 20 = Auto, 1 = Receiver, 2 = Donor
lanpairpeerpeer name stringName of the target peer as seen in the discovery list
lanpairtimeoutinteger ≥ 0Session timeout in minutes; 0 = no limit
lanparti0 / 11 = enable TrustedInstaller impersonation for incoming connections on this machine
[MyLAN]
transfermode=3
server=lanpair://peer/WORKSTATION-01
lanpairrole=0
lanpairpeer=WORKSTATION-01
lanpairtimeout=0
lanparti=0

UI behavior

  • In LAN Pair mode, SSH-specific controls are disabled (key files, Jump Host, Pageant)
  • The lower section shows the LAN Pair session timeout field instead of Unix permissions
  • The connect button label changes to Pair...

Operational notes

  • LAN Pair does not require PHP, SSH, Pageant, or any external SMB mapping
  • File operations (listing, download, upload, rename, delete, mkdir) are all supported
  • Both machines must run Total Commander with this plugin installed

Troubleshooting

ProblemLikely causeFix
Peers not foundWindows Firewall blocking UDP 45845 or machines on different subnetsAllow UDP 45845 inbound in Windows Firewall; verify both machines are on the same network segment
Connection refusedWindows Firewall blocking TCP 45846Allow TCP 45846 inbound on the Receiver machine
"Wrong LAN Pair password, or the stored key no longer matches"The passwords differ, or one computer was paired again with a new passwordPair again with exactly the same password on both computers (case-sensitive)
"No LAN Pair key for this one"The other computer has never been paired with this one, or lost its key (Windows reinstalled, another user account)Pair again with the password; the key is stored again on both sides
"May run a plugin older than 10.3.1"The other computer runs a version without the encrypted protocolUpdate the plugin on both computers
Peers found but classic SMB works — LAN Pair does notUDP broadcast not reaching the other machine (VLAN, managed switch isolation)Check switch/VLAN settings; UDP broadcast must reach port 45845 on both sides
TrustedInstaller files cannot be modifiedTrustedInstaller option not enabled, or TC not running with SeDebugPrivilegeEnable the Trusted Installer checkbox in the connection settings on the machine that owns the files; run Total Commander as Administrator if needed
A stored key cannot be readThe key was saved under a different Windows account or on another installationNothing to delete by hand: an unreadable key in %APPDATA%\GHISLER\sftpplug.secrets is removed, and the next connection made with the password stores it again

Back to index

Jump Host / ProxyJump

Jump Host support allows the plugin to reach the target SSH server through another SSH server (bastion host) without using external ssh.exe.

How it works

  1. TCP connect to the jump host
  2. SSH handshake and authentication on the jump host
  3. Open a direct TCP tunnel to the target host using SSH direct-tcpip
  4. Run the normal target SSH session over that tunnel
Use case: Servers reachable only from a bastion/jump machine, common in segmented internal networks and production environments.

When to use Jump Host

  • Use it only with SSH (SFTP/SCP)
  • Do not use it with PHP Agent
  • Do not use it with PHP Shell
  • Do not use it with LAN Pair

Main dialog behavior

  • Use jump host, the jump-host list and Jump... are enabled only when Transfer = SSH (SFTP/SCP)
  • For PHP and LAN Pair modes these controls are intentionally disabled
  • Jump-host settings remain stored in the profile even when the controls are currently disabled

Manual settings or a saved session

The list next to Jump host: decides where the bastion's settings come from:

  • (manual) - this session's own jump-host settings, entered in Jump...
  • a saved session - that session's host, user and keys are used, so editing it once updates every session that jumps through it. Jump... then shows them read-only and names the session they come from. Picking a session also turns Use jump host on.
  • [!] name (missing) - the referenced session no longer exists, because it was removed outside the plugin (by editing sftpplug.ini, say); the connection is refused rather than made straight to the target, until another entry is picked

A referenced session must reach the bastion directly: one that has a jump host of its own is refused, since chained jump hosts are not supported. Renaming or moving the referenced session inside the plugin keeps the reference valid.

Jump Host settings

  • Host - bastion hostname or IP
  • Port - usually 22
  • User - jump-host account
  • Password - jump-host password, if used
  • Public/Private key - separate key material for the jump host
  • Use SSH agent (Pageant) - optional jump-host authentication via Pageant

Two independent authentication layers

Jump Host and target server are separate SSH identities:

  • the jump host can use one user/key/password
  • the target host can use another user/key/password
  • each side has its own fingerprint verification

Fingerprint handling

  • Target host fingerprint is handled as usual
  • Jump host fingerprint is stored separately as jumpfingerprint
  • On first use or fingerprint change, the plugin asks for confirmation

INI keys

Typical profile keys:

[MyServer]
usejumphost=1
jumphost=bastion.example.com
jumpport=22
jumpuser=ops-user
jumppubkeyfile=C:\Keys\bastion.pub
jumpprivkeyfile=C:\Keys\bastion.ppk
jumpuseagent=1
jumpfingerprint=SHA256:...

With a saved session as the jump host, the profile carries jumpsessionref=<session name> and the session's own jump* keys are not used.

Requirements and limits

  • The jump host must allow direct TCP forwarding / direct-tcpip channels
  • A normal non-root user is sufficient if the SSH server allows this feature
  • Classic HTTP/SOCKS proxies and Jump Host are different layers; do not treat them as the same thing

Failure cases

  • Jump host reachable, target unreachable from bastion
  • Authentication works on bastion, but direct-tcpip is disabled by server policy
  • Saved jump-host fingerprint changed
  • Wrong jump-host credentials with correct target credentials (or the reverse)

Back to index

Authentication Methods

The plugin supports multiple SSH authentication methods and tries them in the order best suited to your configuration.

Available Authentication Methods

Password Authentication

  • Standard username/password login
  • Password stored encrypted via Windows DPAPI (user-account scope)
  • Most widely supported method

Public Key Authentication

  • Uses an SSH key pair (public/private)
  • More secure than password — server never sees the private key
  • Supports PEM (OpenSSH) and PPK (PuTTY) formats
  • Encrypted keys (with passphrase) are supported

SSH Agent (Pageant)

  • Uses keys loaded in the running Pageant agent
  • No need to specify key files in the session
  • Falls back to other methods if no matching key is accepted
  • If Pageant is not running but pageant.lnk exists in the plugin directory, the plugin launches it automatically and retries

Keyboard-Interactive

Keyboard-interactive is a server-driven challenge-response mechanism. The server sends one or more prompts; the plugin answers each one.

  • Used by many hosting providers and corporate SSH servers
  • Common scenarios: standard password prompt, OTP / TOTP code, SMS verification code, security question
  • The plugin handles multiple prompts in sequence automatically — each prompt is shown to you in turn
  • If the server sends a single prompt that looks like a password prompt and you have a password saved in the session, the saved password is used automatically (no dialog shown)
  • If the server sends prompts the plugin cannot satisfy automatically, a dialog appears for each
2FA via keyboard-interactive: If your server requires a password + TOTP code (e.g. Google Authenticator), the plugin will first try the saved password, then prompt you for the OTP code. No special configuration is needed — just answer the prompts as they appear.

Authentication order (fallback chain)

  1. Pageant (if "Use SSH agent" is checked and Pageant is running)
  2. Key file (if a private key file is specified)
  3. Keyboard-interactive
  4. Password

Each method is tried only if advertised by the server. The chain stops at the first success.

Key File Formats

PEM Format (OpenSSH)

  • Standard OpenSSH private key format
  • Generated by ssh-keygen
  • File extension: .pem or no extension
  • RSA, ECDSA (nistp256/384/521), and Ed25519 supported

PPK Format (PuTTY) — native, no external tool needed

  • PuTTY native key format, generated by PuTTYgen
  • File extension: .ppk
  • The plugin converts PPK internally — puttygen.exe is not required and argon2.dll is not needed
  • Argon2 is statically compiled into the plugin
PPK versionKey derivationEncryptionSupport
PPK v2SHA-1 basedAES-256-CBCFull native support
PPK v3Argon2d / Argon2i / Argon2idAES-256-CBCFull native support — no DLL needed

Key format detection

The plugin automatically detects whether a key is PEM or PPK from the file header. You do not need to tell the plugin which format is used.

Using Public Key Authentication

Setup steps

  1. Generate a key pair with ssh-keygen or PuTTYgen.
  2. Copy the public key to the server: append it to ~/.ssh/authorized_keys.
  3. In the plugin dialog, click the >> button next to Private key file and browse to your key.
  4. For PEM keys: the public key field can be left empty (derived automatically).
    For PPK keys: the public key field is also not required — the public key is embedded in the PPK file.
  5. If the key has a passphrase, you will be prompted when connecting.

Passphrase handling

  • Passphrase is prompted at connection time
  • Once entered, it is kept in memory for the rest of the connection, so automatic reconnects do not ask again
  • It is not written to the session profile (by design) and is never sent to the server
  • To avoid the prompt entirely, load the key into Pageant — Pageant caches the unlocked key for the session

Storing a password and a passphrase together

A session holds one password field. When you need both an account password and a key passphrase, put both in it, each in quotes and separated by a comma:

"account password","key passphrase"

The first value is sent to the server, the second only unlocks the private key. Leave the first empty ("","key passphrase") for key-only logins. A field that does not have this exact shape is treated as a plain account password, so ordinary passwords need no quoting.

Using Pageant (SSH Agent)

Setup

  1. Start Pageant (included with PuTTY).
  2. Load your private key(s) into Pageant.
  3. In the plugin dialog, check Use SSH agent (Pageant).
  4. Connect — the plugin queries Pageant for available keys and tries each one.

Auto-launch

If Pageant is not running when you connect, the plugin checks for a file named pageant.lnk in the plugin directory (...\plugins\wfx\SFTPplug\). If found, it launches Pageant automatically, waits briefly, then retries agent authentication.

Common Issues

Key authentication fails

  • Verify the public key is in ~/.ssh/authorized_keys on the server
  • Check server-side permissions: chmod 700 ~/.ssh and chmod 600 ~/.ssh/authorized_keys
  • Enable detailed logging to see which key the plugin attempted

PPK conversion fails

  • Verify the PPK file is not corrupted — try opening it in PuTTYgen as a test
  • argon2.dll is NOT required — Argon2 is built into the plugin. If you see a DLL error, it is unrelated to PPK support
  • Make sure the PPK file path in the session dialog is correct and the file is readable

Pageant not detected

  • Check that Pageant is running (system tray icon)
  • Verify the key is loaded in Pageant (right-click tray icon → View Keys)
  • Ensure Use SSH agent (Pageant) is checked in the plugin dialog
  • If you want Pageant to start automatically, place a pageant.lnk shortcut in the plugin directory

Keyboard-interactive prompts

  • Answer each prompt as shown — the plugin passes your responses to the server in order
  • For 2FA, enter the OTP/TOTP code exactly as shown by your authenticator app
  • If you see unexpected prompts (e.g., a Linux "Last login" message), check whether your server sends informational messages during auth — these are displayed but do not require a response

Security Recommendations

  • Use key authentication when possible
  • Protect private keys with a passphrase and use Pageant to cache the unlocked key
  • Do not store passphrases in session profiles
  • Rotate keys periodically for sensitive systems
  • Keep the plugin directory access-controlled — Pageant auto-launch reads pageant.lnk from there

Back to index

Security Model

Transport security

  • SSH connections (SFTP, SCP, Shell fallback, Jump Host) are always encrypted by the SSH protocol.
  • Use HTTPS for all PHP Agent / PHP Shell traffic. Avoid plain HTTP on any network you do not fully control.
  • LAN Pair authenticates both computers with the pairing password (SPAKE2) and encrypts the whole session with AES-256-GCM.

Password and credential storage

Storage modeINI formatDescription
TC Master Passwordpassword=!Delegated to Total Commander's own CryptProc API
DPAPIpassword=dpapi:<base64>Windows CryptProtectData, bound to your Windows user account
Explicit plaintextpassword=plain:<text>Opt-in only; use only in isolated environments
Legacy XOR<decimal triplets>Read-only; used by very old plugin versions — never written for new sessions
  • All decrypted password buffers are zeroed from memory (SecureZeroMemory) immediately after use.
  • Jump Host credentials are stored and encrypted separately from target-host credentials.
  • The PHP Agent PSK is stored as a salted SHA-256 hash inside sftp.php — the raw secret is not written to disk on the server.

SSH host identity verification

  • The server's fingerprint is stored in sftpplug.ini on first connection, as SHA256 in the form OpenSSH prints it (SHA256:…), so it can be checked on the server with ssh-keygen -lf. The confirmation shows the MD5 as well. An MD5 stored by an earlier version still matches and is rewritten as SHA256 on that connection, without a prompt.
  • On every subsequent connection the fingerprint is compared. A mismatch raises an explicit warning dialog — you must confirm before connecting.
  • Jump Host (bastion) keeps a separate stored fingerprint from the final target host.
  • Accepting a new fingerprint should always be a deliberate decision.

LAN Pair cryptography

  • The pairing password, the same on both computers, becomes a pair key through PBKDF2-HMAC-SHA256 with 120,000 iterations, salted with the two computers' ids.
  • The computers prove the key to each other with SPAKE2 (RFC 9382, P-256). Neither the password nor the key is transmitted, and a recorded exchange gives nothing to guess the password against offline; an attacker who joins in gets one guess per connection, each costing a second.
  • Everything after the handshake is encrypted and authenticated with AES-256-GCM, with a separate key per direction and numbered frames: an altered, replayed or reordered frame ends the connection.
  • Pairing requires the password. After a successful handshake the key is stored encrypted with Windows DPAPI, per peer pair, and used for later sessions.
  • Session timeout is enforced between operations; active transfers are never killed mid-stream.
  • The cryptography is OpenSSL (statically linked) and Windows BCrypt — no third-party DLLs.

Plugin error isolation

Every exported plugin function is wrapped by an exception firewall. If an unexpected error occurs inside the plugin:

  • The exception is caught before it can reach Total Commander.
  • The current operation is aborted and an appropriate error code is returned to TC.
  • A diagnostic dialog is shown with the error type and call location.
  • Total Commander continues running normally — a plugin bug cannot crash the host process.

Key file security

  • Private key files (PEM/PPK) are read only at connection time and not stored in the session profile.
  • PPK v2 and v3 are converted to an in-memory PEM form — the conversion result is never written to disk.
  • Argon2 (PPK v3 key derivation) is statically compiled into the plugin — no separate DLL is involved.

Operational recommendations

  • Use DPAPI password storage (default) rather than plain-text for all sessions.
  • Restrict access to the TC directory containing sftpplug.ini — it holds encrypted credentials.
  • Restrict URL exposure for PHP Agent deployments; use HTTPS with a valid certificate.
  • Rotate SSH keys and PHP Agent passwords periodically.
  • Do not commit sftpplug.ini or sftp.php with live credentials to public repositories.
  • Keep the plugin and PHP runtime up to date.
Important: Security depends on TLS configuration, server hardening, and secret management together — not on the plugin alone.

Back to index

Proxy Configuration

The plugin supports various proxy types for SSH connections. A proxy is a record of its own, kept once and pointed at by as many sessions as you like.

Managing Proxies

Proxies live in the [Proxies] folder in the plugin root, beside [Imports]. Each row is one record, named by its number and what it points at:

  • F7 creates a record and opens its settings.
  • Enter opens the settings of the record under the cursor.
  • F8 deletes it. A record still used by a session is not deleted; the sessions using it are named instead.

The connection dialog carries the list only: pick a record for the session, or pick Add new proxy to make one without leaving the dialog.

Numbers are stable. Deleting record 2 leaves 1 and 3 where they are, so every session keeps the proxy it was pointed at, and the next record created takes a number no session is using.

Supported Proxy Types

No Proxy

Direct connection to the target server. Default setting.

HTTP CONNECT Proxy

  • Uses HTTP CONNECT method to tunnel SSH through HTTP proxy
  • Supports authentication (Basic)
  • Example: proxy.company.com:8080
  • Username/password stored encrypted

SOCKS4a Proxy

  • SOCKS version 4a protocol
  • Supports domain name resolution (the "a" suffix)
  • No authentication support
  • Example: socks4a://proxy:1080

SOCKS5 Proxy

  • Full SOCKS version 5 protocol
  • Supports authentication (username/password)
  • Supports IPv4, IPv6, and domain names
  • Example: socks5://user:pass@proxy:1080

System Default Proxy

Uses Windows system proxy settings from Internet Options.

Proxy Configuration Fields

  • Proxy server:
    • Format: hostname or hostname:port
    • Default ports: 8080 (HTTP), 1080 (SOCKS)
  • Username: Optional proxy authentication username
  • Password: Optional proxy authentication password (encrypted storage)

Proxy Error Codes

ErrorMeaningSolution
Connection not allowedProxy policy blocks destinationCheck proxy ACL rules
Network unreachableTarget network not routableVerify network configuration
Host unreachableSpecific host not reachableCheck host availability
Connection refusedTarget actively refusedVerify service is running
TTL expiredRouting loop or timeoutCheck routing configuration
Command not supportedProxy doesn't support operationTry different proxy type
Address type not supportedIPv6/hostname not supportedUse IPv4 or different proxy

Proxy Authentication

When proxy requires authentication:

  1. Enter username in Username field
  2. Enter password in Password field
  3. Password is stored encrypted via DPAPI
  4. For SOCKS5, authentication is negotiated during connection

Proxy with SSH Key Authentication

Proxy settings are independent of SSH authentication. You can use:

  • Proxy + password authentication
  • Proxy + public key authentication
  • Proxy + Pageant (SSH agent)

Troubleshooting

Proxy connection fails immediately

  • Verify proxy server is reachable: telnet proxy:port
  • Check proxy type matches server capability
  • Verify credentials if authentication required

Connection works without proxy but not with

  • Check proxy server logs for denied connections
  • Verify proxy allows CONNECT to target port (usually 22)
  • Try SOCKS5 if HTTP CONNECT fails

SOCKS5 authentication fails

  • Ensure SOCKS5 (not SOCKS4a) is selected
  • Verify username/password are correct
  • Check if proxy requires specific authentication method
Security note: Proxy passwords are stored encrypted, but the proxy connection itself may not be encrypted. Use SOCKS5 or HTTPS proxy for sensitive environments.

Back to index

Shell Fallback

This plugin includes shell-based transfer strategies for servers where SFTP/SCP are restricted or unreliable.

Why this matters

  • Some hosts allow shell commands but block normal SFTP/SCP channels
  • Some tools (including standard clients) fail there; plugin can continue using shell pipelines
  • Shell fallback can succeed where typical tools often fail

Implemented paths

  • Raw shell transfer: cat stream paths for direct data movement
  • dd block transfer: Controlled block-size transfers with offset support
  • Base64 chunk transfer: Robust fallback for restrictive environments
  • Resume alignment: Base64 resume aligns to 3-byte boundaries to keep integrity
  • SCP shell mode: SCP protocol over shell channel

Commands used

The plugin uses standard Unix commands:

  • cat - Raw file streaming
  • dd - Block-level copy with offset
  • base64 - Encoding for text-only channels
  • ls, mkdir, rm, mv - File operations
  • stat - File metadata

When to enable

  • Enable Use shell transfer (for blocked hosts) when SCP/SFTP fail due to host policy
  • Use together with SCP settings depending on host behavior
  • For maximum force behavior, use shell transfer force workflow
  • SFTP subsystem unavailable errors
  • SCP permission or protocol errors

Transfer methods

Method 1: Raw cat

Download: cat /remote/file.txt
Upload:   cat > /remote/file.txt

Fast, no encoding overhead. Best for simple cases.

Method 2: dd with blocks

Download: dd if=/remote/file.txt bs=16384 skip=N
Upload:   dd of=/remote/file.txt bs=16384 seek=N conv=notrunc

Precise offset control for resume operations.

Method 3: Base64 encoding

Download: base64 -w 0 /remote/file.txt
Upload:   base64 -d > /remote/file.txt

Most robust - works through any text-only channel. 33% size overhead.

Performance considerations

  • Raw cat: Fastest, no overhead
  • dd: Moderate overhead, good for resume
  • Base64: 33% size increase, encoding/decoding CPU cost
  • Plugin auto-selects best method based on server capabilities

Security notes

  • Filenames properly shell-escaped
  • Path traversal prevented
  • Commands executed within user's permission scope
Note: Shell fallback prioritizes compatibility over terminal semantics. Some interactive features may not work.

See also

Back to index

Shell Fallback Commands

When SFTP/SCP are blocked, the plugin can use shell command pipelines for file transfers. This page documents the shell commands used.

Overview

Why Shell Fallback?

  • Some hosts disable SFTP subsystem
  • SCP may be restricted by administrator
  • Shell access often still available
  • Plugin uses standard Unix commands for transfer

When to Enable

  • SFTP connection fails with "Subsystem request failed"
  • SCP transfers fail with permission errors
  • Host policy blocks standard transfer methods
  • Enable: Use shell transfer (for blocked hosts)

Transfer Methods

Method 1: Raw cat Stream

Direct streaming for simple cases:

Download

cat /remote/path/file.txt
  • Outputs file content to stdout
  • Plugin captures and writes to local file
  • Fast, no encoding overhead

Upload

cat > /remote/path/file.txt
  • Plugin sends file content to stdin
  • Shell redirects to target file
  • Simple but effective

Method 2: dd with Block Size

Controlled block transfer:

Download with Offset

dd if=/remote/path/file.txt bs=16384 skip=10
  • if= Input file path
  • bs= Block size (16384 bytes)
  • skip= Blocks to skip (for resume)
  • Precise control over read position

Upload with Append

dd of=/remote/path/file.txt bs=16384 seek=10 conv=notrunc
  • of= Output file path
  • seek= Blocks to seek (for resume)
  • conv=notrunc Don't truncate existing file
  • Good for large file resume

Method 3: Base64 Encoding

Most robust fallback for restrictive environments:

Download with Base64

base64 -w 0 /remote/path/file.txt
  • Encodes binary to ASCII
  • -w 0 No line wrapping (single line)
  • Plugin decodes base64 locally
  • Handles any file type safely

Upload with Base64

base64 -d > /remote/path/file.txt
  • Plugin encodes file to base64
  • Shell decodes and writes to file
  • -d Decode mode
  • Works through any text-only channel

Resume Strategies

Base64 Resume Alignment

Base64 encoding has special handling for resume:

  • Base64 encodes 3 bytes → 4 characters
  • Resume must align to 3-byte boundaries
  • Plugin calculates correct skip position
  • Ensures decoded output is byte-perfect

Resume Example

# File is 10000 bytes, already have 3000
# 3000 bytes = 1000 blocks of 3 bytes
# Base64: 1000 * 4 = 4000 characters to skip

base64 -w 0 file.txt | tail -c +4001 | base64 -d >> partial.file

Directory Operations

List Directory

ls -la /remote/path/
  • Detailed listing with permissions
  • Plugin parses output for file info
  • Handles spaces in filenames

Create Directory

mkdir -p /remote/path/newdir
  • -p Create parent directories
  • Recursive creation
  • No error if exists

Remove File

rm -f /remote/path/file.txt
  • -f Force, no prompt
  • Silent success

Remove Directory

rm -rf /remote/path/olddir
  • -r Recursive
  • -f Force
  • Use with caution

Rename/Move

mv /remote/path/old.txt /remote/path/new.txt
  • Works across same filesystem
  • Atomic on same partition

Get File Info

stat /remote/path/file.txt
  • Shows size, permissions, timestamps
  • Plugin parses for metadata

Shell Detection

Available Commands

Plugin tests for command availability:

which cat
which dd
which base64
which ls
which mkdir
which rm
which mv
which stat

Fallback Order

  1. Try SFTP native operations
  2. Try SCP commands
  3. Try shell cat/dd
  4. Try base64 encoding
  5. Last resort: chunked base64

SCP Shell Mode

SCP with Shell Fallback

Some hosts need shell for SCP operations:

SCP Send

scp -t /remote/path/file.txt
  • -t Target mode (receive file)
  • Plugin sends file metadata + content
  • Server acknowledges each step

SCP Receive

scp -f /remote/path/file.txt
  • -f From mode (send file)
  • Server sends metadata + content
  • Plugin acknowledges receipt

SCP Shell Protocol

# Plugin sends:
T1234567890 0 1234567890 0  (timestamps)
C0644 1234 file.txt  (file mode, size, name)
[...file content...]
\0  (null terminator)

# Server responds with:
\0  (OK)
\1error  (Error)
\2fatal error  (Fatal)

Error Handling

Command Not Found

  • Plugin tries alternative commands
  • Example: no base64 → try uuencode
  • Last resort: report error

Permission Denied

  • Check remote file permissions
  • Verify user has write access
  • Try alternative location

Command Timeout

  • Default timeout: 20 seconds
  • Large files may need more time
  • Plugin sends keepalive during transfer

Partial Transfer

  • Connection interrupted mid-transfer
  • Plugin detects incomplete file
  • Resume from last good position
  • Base64 resume aligned to boundaries

Performance Considerations

Base64 Overhead

  • Base64 increases size by ~33%
  • Encoding/decoding CPU cost
  • Use only when necessary
  • Still faster than no transfer at all

Block Size Tuning

  • Default: 16384 bytes (16 KB)
  • Larger blocks: more efficient
  • Smaller blocks: better for slow links
  • Auto-tuned based on connection

Latency Impact

  • Shell commands round-trip latency
  • Pipelining where possible
  • Batch small operations

Security Notes

Command Injection Protection

  • Filenames properly escaped
  • Shell metacharacters quoted
  • Path traversal prevented

Shell Quoting

# Filename with spaces:
cat "/remote/path/my file.txt"

# Filename with special chars:
cat '/remote/path/file$var.txt'
Note: Shell fallback prioritizes compatibility over terminal semantics. Some interactive features may not work.
Tip: If shell transfer works but is slow, try enabling compression in SSH settings or use base64 for binary files only.

Back to index

PHP Agent (HTTP)

PHP Agent lets you manage files on a web server via HTTP — without any SSH account or SSH daemon. The entire server-side logic lives in one file: sftp.php.

Typical use case: shared hosting where you have FTP/SFTP disabled or no shell access, but PHP is available.

Important — read before you do anything:
The sftp.php included in the plugin package has no password configured. If you upload it to your server before setting a password in the plugin, the server will reject every connection with HTTP 503. Always set the password in the plugin dialog first, save the session, then upload.

How it works — the big picture

  1. You choose a password for the connection.
  2. The plugin stores a salted SHA-256 hash of that password into your local sftp.php. The password itself is never written to any file.
  3. You upload that modified sftp.php to your web server.
  4. When you connect, the plugin signs every request (HMAC-SHA256) with a key derived from the password: the same salted hash that is stored in sftp.php. The password itself never leaves your computer. The server checks the signature, the time and a single-use nonce, and refuses any request whose operation, parameters or content were altered on the way.

This means: your password is in no file and on no network. The hash in sftp.php, however, is the key the server checks signatures with — whoever can read that file can send signed requests. Keep it readable by the web server only (permissions 600 or 640), and use a long random password: the hash is a single salted SHA-256, so a short or common password can be guessed from it offline.

Use HTTPS. Signing protects the password and the requests on plain HTTP too, but not your files: over http:// anyone on the network path sees every file and listing you transfer. HTTPS encrypts them.

Step-by-step deployment

Step 1 — Set up the connection in Total Commander

Open the plugin connection dialog (Net → Connect, or the Network Neighborhood panel). Fill in:

FieldWhat to enterExample
Connect to:Full HTTPS URL to sftp.php on your server (the file does not exist yet — enter where it will be)https://example.com/sftp.php
Transfer mode:Select PHP Agent (HTTP) from the dropdown—
Password:Choose any password — this will be your shared secret between TC and the serverMySecretPass123
Session name:Give the session a name for easy identificationMy Hosting
URL format: Always use https:// in production. Plain http:// is for local testing only — over HTTP the files and listings you transfer travel unencrypted.

Step 2 — Save the session

Click Save (or press F2 if available). At this point the plugin:

  • Encrypts the password with Windows DPAPI and stores it in sftpplug.ini
  • Opens its local copy of sftp.php and writes two fields into it: AGENT_PSK_SALT (random) and AGENT_PSK_SHA256 (SHA-256 hash of salt + your password)

The local sftp.php that now contains your password hash is located at:

...\Total Commander\plugins\wfx\SFTPplug\sftp.php

This is the file you will upload. Do not use the original sftp.php from the download package — it has empty PSK fields.

Step 3 — Upload sftp.php to your server

Copy the file from the path above to your web server so that it is accessible at the URL you entered in Step 1.

Example: if you entered https://example.com/sftp.php, upload the file to the root of your web space as sftp.php.

You can upload it using any method: FTP, cPanel File Manager, your hosting control panel, or any other file manager.

File permissions on Linux servers: Set sftp.php to mode 644 (readable by web server, not world-writable).

Step 4 — Verify the endpoint

Before connecting, verify the script is reachable and correctly configured. Open this URL in your browser:

https://example.com/sftp.php?op=PROBE

Expected responses:

ResponseMeaning
HTTP 200 with JSON containing "ok":trueAll good — proceed to connect
HTTP 401 UnauthorizedScript is running but waiting for auth — this is also OK (plugin will authenticate)
HTTP 503 Service UnavailablePSK not configured — you uploaded the wrong file (without hash). Repeat from Step 2.
HTTP 404 Not FoundWrong URL or file not uploaded yet
PHP error pagePHP version too old (<7.4) or required extension disabled on server

Step 5 — Connect

Select your saved session in Total Commander and connect. The plugin probes the endpoint, confirms capabilities, and opens the remote file panel.

What is stored where — security summary

LocationWhat is storedIs the password exposed?
sftpplug.ini (on your PC)Password encrypted with Windows DPAPI (user-account bound)No — DPAPI ciphertext only
sftp.php (on server)AGENT_PSK_SALT (random) + AGENT_PSK_SHA256 = SHA-256(salt + password)No — one-way hash only. The hash is the signing key, though: protect the file like a password
Network trafficA signature per request (HMAC-SHA256, single-use nonce, 5-minute window) — never the passwordNo. Over plain HTTP the transferred files and listings themselves are readable
In short: No file and no request holds your password. The hash in sftp.php signs requests, so keep that file private to the web server. HTTPS keeps the transferred files private as well, and is required for anything beyond local testing.

URL formats

https://example.com/sftp.php
https://example.com/tools/sftp.php
https://example.com:8443/sftp.php
http://192.168.1.10/sftp.php         (local testing only — no encryption)

TAR Stream mode

When the TAR stream checkbox is enabled in the connection dialog, all directory downloads and batch file transfers are handled as a single TAR archive exchange instead of individual HTTP requests. This eliminates per-request overhead and is critical on shared hosting (OVH, home.pl) where thousands of individual GET/PUT requests would be extremely slow.

Batch Download (TAR_PACK)

When you copy multiple remote files or a remote directory to local, the plugin collects all file paths during the TC copy operation and sends a single POST ?op=TAR_PACK request with all paths listed in the body (one per line). The server-side sftp.php streams a ustar TAR archive of exactly those files directly to the response — without any temporary file or memory buffer. The plugin parses the TAR on the fly, creates local directories and files as each entry arrives, and shows a progress bar based on file count. GNU long-name entries (././@LongLink) are fully supported for paths over 99 characters.

Directory Download (TAR_STREAM)

When you copy an entire remote directory to local, the plugin sends one GET ?op=TAR_STREAM&path=... request. The server streams a ustar TAR of the entire directory tree. The plugin parses and extracts on the fly.

Upload (TAR_EXTRACT)

When you copy multiple local files or directories to a remote location, the plugin batches all of them into a single ustar TAR stream and sends one POST ?op=TAR_EXTRACT&path=... request. The server extracts the archive. Batching is transparent to Total Commander — files are queued during the copy operation and sent all at once when TC signals end-of-batch. The total archive size is sent as a proper 64-bit Content-Length header, so uploads of directories exceeding 4 GB work correctly.

Note: TAR mode requires a current version of sftp.php on the server (one that supports TAR_STREAM, TAR_EXTRACT, and TAR_PACK). Always upload the sftp.php from the plugin directory — not an older copy. Resume is not supported for TAR transfers; if interrupted, re-copy the whole set.

Upload method and chunk size

When PHP Agent or PHP Shell mode is active, the connection dialog shows two extra controls (replacing the encoding codepage and system dropdowns):

  • Method (Auto / POST / PUT) — HTTP verb used for single-file uploads.
    • Auto (default): tries POST first, falls back to PUT if the server rejects it.
    • POST: always uses multipart POST.
    • PUT: always uses raw PUT body.
  • Chunks (Auto / 2 / 4 / 8 / 16 / 32 / 64 MiB) — upload chunk size per request.
    • Auto (default): uses the recommended_chunk_size from the server's PROBE response, clamped to 1–64 MiB. Falls back to 1 MiB if the server does not advertise a recommendation.
    • Fixed sizes: override server recommendation when PHP limits or network conditions require it.

Capabilities

  • LIST — directory listing with name, size, modification time, permissions
  • GET — file download
  • PUT — file upload (chunked)
  • DELETE / RMDIR — remove files and directories
  • MKDIR — create directories (recursive)
  • RENAME — rename or move files
  • STAT — file/directory info
  • HASH — compute file hashes on server
  • TAR_STREAM — stream entire directory tree as ustar TAR (download)
  • TAR_EXTRACT — upload files/directories as ustar TAR (batch upload)
  • TAR_PACK — pack selected remote files into ustar TAR (batch download)
  • SHELL_EXEC — execute shell commands (PHP Shell mode; requires shell_exec enabled)

PHP Shell Console

If shell_exec is available on your server, you can use PHP Shell (HTTP) transfer mode for a pseudo-terminal experience:

  • Run shell commands from within Total Commander
  • Working directory tracking across commands
  • Command history (Up/Down arrows)

Uses the same sftp.php file — no separate deployment needed.

The shell is not confined to the agent root. File operations stay inside the folder sftp.php lives in (AGENT_ROOT), but shell commands run as the web server user and reach everything that user can. Anyone holding the password gets that access. If you do not need the shell, open sftp.php and set const AGENT_ALLOW_SHELL = false; — the agent then refuses SHELL_EXEC and the password gives file access only.

Server requirements

  • PHP 7.4 or later (PHP 8.x recommended)
  • Standard file and directory functions (fopen, opendir, etc.) — must not be in disable_functions
  • hash and json extensions (enabled by default on most hosts)
  • For PHP Shell: shell_exec or proc_open not disabled

PHP INI limits that affect uploads

  • upload_max_filesize — maximum size per chunk
  • post_max_size — must be larger than upload_max_filesize
  • max_execution_time — increase for large files on slow servers
  • memory_limit — 128 MB or more recommended

The plugin reads these limits via PROBE and adjusts chunk size automatically.

Troubleshooting

ErrorCauseFix
HTTP 503Uploaded the raw sftp.php without PSK configuredSave session in plugin first, then re-upload the modified sftp.php from the plugin directory
HTTP 401Password in plugin does not match hash in sftp.phpRe-save the session with the correct password, re-upload sftp.php
HTTP 404sftp.php not at the URL you enteredVerify the URL and that the file was uploaded to the correct path
HTTP 500PHP error on serverCheck server PHP error log; verify PHP version ≥ 7.4 and required functions not disabled
Connection refused / timeoutServer unreachable or HTTPS certificate errorTest URL in browser; check SSL certificate validity
TAR batch download — 0 files receivedOld sftp.php without TAR_PACK support, or path mismatchUpload the current sftp.php from the plugin directory to the server
HTTP 504 on TAR download (OVH/home.pl)Old sftp.php that buffers TAR in php://temp before sendingUpload the current sftp.php — streaming version eliminates the timeout
TAR upload fails for large directories (>4 GB)Old plugin build — 32-bit integer overflow in Content-LengthUpdate the plugin to the current build

See also

Back to index

PHP Agent Operations

PHP Agent enables file operations over HTTP when SSH access is unavailable. Ideal for shared hosting environments.

Overview

What is PHP Agent?

  • Single PHP file (sftp.php) deployed to web server
  • Provides file operations via HTTP API
  • Password authentication on every request (HTTPS required outside local testing)
  • Supports file listing, upload, download, delete, rename, mkdir
  • No SSH account required - works with web hosting

Capabilities

  • LIST: Directory listing with file metadata
  • STAT: File/directory information
  • GET: Download files with range support
  • PUT: Upload files with chunked transfer
  • DELETE: Remove files
  • MKDIR: Create directories (recursive)
  • RMDIR: Remove directories
  • RENAME: Rename/move files
  • HASH: Compute file hashes (SHA256, etc.)
  • TAR_STREAM: Stream entire directory tree as ustar TAR (bulk download)
  • TAR_PACK: Pack selected remote files as ustar TAR (batch download)
  • TAR_EXTRACT: Extract ustar TAR uploaded by plugin (batch upload)
  • SHELL_EXEC: Execute shell commands (if enabled)

Deployment Guide

Step 1: Configure Plugin

  1. Open connection dialog
  2. Select transfer mode: PHP Agent (HTTP)
  3. Enter URL: https://example.com/sftp.php
  4. Enter username (optional, for identification)
  5. Enter password (will be used as PSK - Pre-Shared Key)
  6. Save session

Step 2: Generate sftp.php

  1. After saving password, plugin generates sftp.php
  2. Located in plugin runtime directory (next to plugin DLL): ...\\plugins\\wfx\\sftpplug\\sftp.php (build also copies it to build\\bin\\sftp.php)
  3. Contains derived authentication constants
  4. Ready for upload to server

Step 3: Upload to Server

  1. Use FTP, control panel, or other method
  2. Upload sftp.php to web-accessible location
  3. Note the full URL for plugin configuration
  4. Ensure file permissions allow execution (755 typical)

Step 4: Test Connection

  1. Enter URL in plugin: https://example.com/sftp.php
  2. Click Connect
  3. Plugin probes endpoint for capabilities
  4. On success, ready for file operations

Authentication

PSK (Pre-Shared Key)

Three configuration methods (in order of preference):

  1. Environment Variable (Recommended):
    AGENT_PSK=your_secret_key_here
    Environment keys checked: TC_SFTP_AGENT_PSK, SFTP_AGENT_PSK, AGENT_PSK
  2. Constant in sftp.php:
    const AGENT_PSK = 'your_secret_key_here';
  3. Salted Hash (for deployment):
    const AGENT_PSK_SALT = 'random_salt';
    const AGENT_PSK_SHA256 = 'sha256(salt:psk)';
    Allows upload-only deployment without knowing plain PSK

Signed Requests (TCSFTP-HMAC-V2)

The password never travels. Every request except PROBE carries:

X-SFTP-TS:             Unix time of the request
X-SFTP-NONCE:          random, 8-128 characters [A-Za-z0-9._-], never reused
X-SFTP-CONTENT-SHA256: hex SHA-256 of the request body (of "" when there is none)
X-SFTP-SIGNATURE-V2:   hex HMAC-SHA256(key, "TCSFTP-HMAC-V2" \n METHOD \n OPERATION \n
                       canonical query \n content SHA-256 \n timestamp \n nonce)
  • Key: hex SHA-256 of AGENT_PSK_SALT ":" password — exactly the value AGENT_PSK_SHA256 holds, so an agent that stores only the hash verifies signatures too. With a plain PSK (environment variable or AGENT_PSK) the agent derives the same key itself. PROBE tells the client the salt.
  • Canonical query: every URL parameter percent-decoded, sorted by name and then value, and encoded again per RFC 3986. The signature thus covers all parameters (path, to, cmd, offset, ...), and the body through its hash.
  • Body: checked before it is used. An upload chunk is staged and written to its file only when its hash matches; a TAR upload is staged whole and extracted only then — a damaged or altered upload changes nothing on the server.
  • Replay: the timestamp must lie within 300 seconds of the server's clock (the plugin reads that clock from PROBE), and each nonce is accepted once.

The PSK in the clear (X-SFTP-AUTH) and the partial signature of plugins before 10.3.1 are refused unless const AGENT_ACCEPT_LEGACY_AUTH = true; is set in sftp.php — only while such a plugin still has to connect. A plugin from 10.3.1 on refuses an agent that does not sign and says so; it never falls back to sending the password.

The signing key is in sftp.php as the hash: keep the file readable by the web server only. Signing protects the password and every request on plain HTTP too, but not the files themselves — use HTTPS so that transfers stay private.

Security Features

  • Root confinement: file operations stay inside AGENT_ROOT; paths with .., and links pointing outside the root, are refused
  • Root protection: the root folder itself cannot be removed or renamed
  • Anonymous PROBE: unsigned, it returns only the agent name and version, the signing scheme and salt, and the recommended chunk size
  • Signed requests: expire after 300 seconds, each nonce is accepted once, and nothing in them can be altered unnoticed
The shell is not confined. SHELL_EXEC runs any command as the web server user, outside AGENT_ROOT too. Whoever holds the password has that access. Set const AGENT_ALLOW_SHELL = false; in sftp.php when the shell is not needed.

URL Format

Basic URL

https://example.com/sftp.php
https://example.com/path/to/sftp.php
https://example.com/sftp.php?path=/subdir

With Port

https://example.com:8443/sftp.php

Path Parameter

Can specify path in URL or via parameter:

https://example.com/sftp.php?path=files
https://example.com/sftp.php?path=%2Fvar%2Fwww

Operations Reference

PROBE - Capability Detection

Automatic on first connection:

GET https://example.com/sftp.php?op=PROBE

Response to an unsigned PROBE:
{
  "ok": true,
  "agent": { "name": "TC PHP Agent", "version": "1.1.0" },
  "auth": { "scheme": "TCSFTP-HMAC-V2", "salt": "3f9c..." },
  "capabilities": { "recommended_chunk_size": 1048576 }
}

Response to a signed PROBE:
{
  "ok": true,
  "agent": { "name": "TC PHP Agent", "version": "1.1.0" },
  "capabilities": { "recommended_chunk_size": 1048576, "operations": [...], ... },
  "runtime": { "php_version": "8.2", "sapi": "apache2handler" },
  "ini": { "upload_max_filesize": "256M", ... }
}

Upload Chunk Policy

  • Auto mode: uses capabilities.recommended_chunk_size from PROBE
  • Safety clamp: plugin limits Auto to 1..64 MB
  • Fallback: if recommendation is unavailable, Auto uses 1 MB
  • Manual: 2 / 4 / 8 / 16 / 32 / 64 MB

LIST - Directory Listing

GET https://example.com/sftp.php?op=LIST&path=/subdir

Response (JSON):
{
  "ok": true,
  "path": "subdir",
  "items": [
    { "name": "file.txt", "is_dir": false, "size": 1234, "mtime": 1234567890, "perms": "0644" }
  ]
}

Response (Plain):
F\t1234\t1234567890\tbase64(filename)
D\t0\t1234567890\tbase64(dirname)

GET - Download File

GET https://example.com/sftp.php?op=GET&path=file.txt&offset=0&length=1024

Headers:
Content-Type: application/octet-stream
Content-Length: 1024
X-SFTP-File-Size: 5000
X-SFTP-Offset: 0
Accept-Ranges: bytes

PUT - Upload File

POST https://example.com/sftp.php?op=PUT&path=file.txt&offset=0

Headers:
Content-Type: multipart/form-data or raw POST data
X-SFTP-Content-SHA256: sha256hash (optional verification)

Response:
{
  "ok": true,
  "path": "file.txt",
  "written": 1024,
  "size": 5000,
  "sha256": "abc123...",
  "part": true
}

FINALIZE - Complete Upload

POST https://example.com/sftp.php?op=FINALIZE&path=file.txt&overwrite=1

Response:
{
  "ok": true,
  "path": "file.txt",
  "size": 5000,
  "finalized": true
}

DELETE - Remove File

POST https://example.com/sftp.php?op=DELETE&path=file.txt

Response:
{ "ok": true, "deleted": true, "path": "file.txt" }

MKDIR - Create Directory

POST https://example.com/sftp.php?op=MKDIR&path=newdir&recursive=1&mode=0775

Response:
{ "ok": true, "created": true, "path": "newdir" }

mode is three octal digits, optionally with a leading zero; anything else is refused with INVALID_MODE.

RMDIR - Remove Directory

POST https://example.com/sftp.php?op=RMDIR&path=olddir&recursive=0

Response:
{ "ok": true, "removed": true, "path": "olddir", "recursive": false }

The agent root is refused with ROOT_PROTECTED. A link to a directory is removed as a link; the directory it points to stays. The same holds for DELETE and RENAME: they act on the link, not on its target.

RENAME - Move/Rename

POST https://example.com/sftp.php?op=RENAME&from=old.txt&to=new.txt&overwrite=1

Response:
{ "ok": true, "renamed": true, "from": "old.txt", "to": "new.txt" }

HASH - Compute File Hash

GET https://example.com/sftp.php?op=HASH&path=file.txt&algo=sha256

Response:
{ "ok": true, "path": "file.txt", "algo": "sha256", "hash": "abc123..." }

TAR_STREAM - Stream Entire Directory as TAR

GET https://example.com/sftp.php?op=TAR_STREAM&path=/subdir

Response: raw ustar TAR stream (application/x-tar)

The server streams the entire directory tree as a ustar TAR archive. The plugin parses the stream on the fly: directories are created immediately, files are written as their data arrives. GNU long-name extension records (././@LongLink, typeflag L) are handled for paths longer than 99 characters. The stream ends with two consecutive 512-byte zero blocks (standard TAR end-of-archive marker). Used when downloading an entire directory.

Enabled when the TAR stream checkbox is checked and a single directory is being downloaded.

TAR_PACK - Batch Download Selected Files as TAR

POST https://example.com/sftp.php?op=TAR_PACK
Content-Type: text/plain

relative/path/file1.txt
relative/path/file2.bin
subdir/file3.jpg

Response: raw ustar TAR stream (application/x-tar)

The plugin sends a list of relative remote paths (one per line, newline-separated) in the POST body. The server packs exactly those paths into a ustar TAR and streams the result directly to the response — no temporary file, no memory buffer, no Content-Length header. The plugin parses the TAR on the fly and writes each file to the local destination as it arrives.

Directories listed are included as directory entries (typeflag 5). Files larger than 8 589 934 591 bytes are skipped (POSIX ustar octal limit) without corrupting the rest of the archive. GNU LongLink is used for paths over 99 characters.

Enabled when the TAR stream checkbox is checked and multiple files are selected for download (TC GET_MULTI batch operation).

TAR_EXTRACT - Upload Files as TAR

POST https://example.com/sftp.php?op=TAR_EXTRACT&path=/subdir
Content-Type: application/x-tar
Content-Length: <exact 64-bit size>
[ustar TAR body]

Response:
{ "ok": true, "extracted": N }

The plugin packs all queued files into a single ustar TAR stream (with GNU long-name entries where needed) and sends it in one POST. The server extracts it under path. Files are queued during the TC copy operation and sent all at once when TC signals end-of-batch via FsStatusInfo. Content-Length is sent as a proper 64-bit value — no overflow for archives exceeding 4 GB.

Enabled when the TAR stream checkbox is checked and files are being uploaded.

SHELL_EXEC - Execute Command

POST https://example.com/sftp.php?op=SHELL_EXEC&cmd=ls+-la&cwd=/var/www

Response:
{
  "ok": true,
  "cwd": ".",
  "cwd_abs": "/var/www",
  "method": "shell_exec",
  "exit_code": 0,
  "stdout_b64": "base64_encoded_output",
  "stderr_b64": "base64_encoded_errors"
}

With AGENT_ALLOW_SHELL = false the agent answers HTTP 403 SHELL_DISABLED.

PHP Shell Console

Overview

Pseudo-terminal interface for command execution:

  • HTTP-based command execution
  • Working directory tracking
  • Command history (Up/Down arrows)
  • Output colorization
  • Basic completion suggestions

Opening Shell

  1. Connect with PHP Agent or PHP Shell mode
  2. Click Shell... button
  3. Plugin validates authentication first
  4. Console opens with prompt showing host and path

Shell Features

  • Command history: Up/Down arrows
  • Tab completion: Basic filename completion
  • Working directory: Displayed in prompt
  • Output separation: Command vs output coloring

Limitations

  • Not a full PTY/TTY emulator
  • Interactive programs may not work (vi, top)
  • Some terminal escape sequences not handled

Configuration Options

PHP Server Requirements

  • PHP 7.4 or later (PHP 8.x recommended)
  • File functions enabled
  • Directory functions enabled
  • Hash extension available
  • JSON extension available

PHP INI Limits

  • upload_max_filesize: Maximum single upload
  • post_max_size: Maximum POST data
  • max_execution_time: Script timeout
  • memory_limit: Memory per request

Agent Constants

AGENT_NAME = 'TC PHP Agent'
AGENT_VERSION = '1.0.2'
AGENT_PSK = 'CHANGE_ME_TO_LONG_RANDOM_SECRET'
AGENT_PSK_SALT = ''
AGENT_PSK_SHA256 = ''
AGENT_ROOT = __DIR__  (or custom path)
AGENT_ALLOW_SHELL = true  (false refuses SHELL_EXEC)
AGENT_NONCE_TTL = 300
AGENT_DEFAULT_CHUNK = 262144
AGENT_MAX_LIST_ITEMS = 20000

Troubleshooting

HTTP 401 - Authentication Failed

  • Verify password matches PSK in sftp.php
  • If sftp.php holds only the salted hash, re-save the session and upload the regenerated file

HTTP 403 - Path Escape Attempt

  • Requested path goes outside AGENT_ROOT
  • Adjust AGENT_ROOT if needed
  • Use relative paths within allowed root

HTTP 404 - Not Found

  • Verify URL points to actual sftp.php location
  • Check file permissions (executable)
  • Ensure mod_rewrite not interfering

HTTP 503 - Service Unavailable

  • AGENT_PSK not configured
  • Set environment variable or constant
  • Deploy properly generated sftp.php

Upload Fails

  • Check PHP upload limits (upload_max_filesize)
  • Verify disk space on server
  • Check directory permissions
  • Review PHP error logs

Download Returns Empty File

  • Verify file is readable
  • Check open_basedir restrictions
  • Ensure file exists at specified path
Security Warning: Always use HTTPS for PHP Agent in production. Requests are signed and the password never travels, but over plain HTTP the files and listings you transfer are readable by anyone on the path.
Tip: Use environment variables for PSK in production. Never commit sftp.php with real secrets to version control.

Back to index

PHP Shell Console

Console-style pseudo-terminal over HTTP for remote command execution through sftp.php.

Features

  • Prompt with host and working directory.
  • Command history (Up/Down).
  • Basic completion and list suggestions.
  • Colored output: prompt/command/output separation.

Open behavior

The Shell... button validates PHP auth first. On auth errors, console does not open and an explicit error is shown.

Known limits

  • This is not a full PTY/TTY emulator.
  • Some terminal-native behaviors may differ from PuTTY/OpenSSH shell.

Back to index

Session Management

The plugin provides comprehensive session management for storing and organizing connection configurations.

Saved Sessions

Creating a Session

  1. Open connection dialog (Ctrl+F1)
  2. Enter connection settings (host, username, authentication, etc.)
  3. Press F7 or click in session field
  4. Enter session name in the dialog (Total Commander shows "New folder" - this is expected)
  5. Settings are automatically saved under that name

Editing a Session

  1. Select the session in the plugin panel
  2. Press Alt+Enter
  3. Modify settings as needed
  4. Changes are saved automatically

Deleting a Session

  • Select the session in the plugin panel
  • Press F8 or Delete
  • Confirm deletion

Keyboard Shortcuts

KeyAction
F7Create new session (works inside folders too)
F8 / DeleteDelete selected session or folder (folders remove every session inside)
EnterOpen a folder, or connect to a session with current settings
F3 / F4Show session settings as an INI snippet (read-only; edit with Alt+Enter)
Alt+EnterEdit selected session
F6Rename / move a session or folder (see "Folders" below)
EscapeCancel connection attempt

Organising Sessions in Folders

Saved sessions can be grouped into folders for easier navigation when you accumulate many of them. Folders are implicit: they exist as long as at least one session lives under them, and disappear when the last one is removed. There is no separate "create empty folder" step.

Putting Sessions into a Folder

  • From scratch: press F7 inside an existing folder — the new session is created in that folder automatically (folder name is taken from the current path).
  • Move an existing session: press F6 on the session and type a new path that includes a folder, e.g. \work\web1. The folder appears in the listing on the next refresh.
  • Manually: save a session whose Display Name uses / as a hierarchy separator (e.g. work/web1). The plugin splits on / when building the listing.

Renaming or Moving a Folder

Press F6 on a folder entry to rename it. All sessions under the folder are renamed in one go — both the INI section names and any jumpsessionref values pointing into the folder are updated, so jump-host references survive the rename.

Deleting a Folder

F8 on a folder removes every session in it (recursively). Total Commander shows its standard "delete non-empty folder?" confirmation first. Jump-host references targeting the deleted sessions are cleared so the by-reference picker does not surface them as broken markers.

Copying and Moving with F5 / F6 / Drag-and-Drop

Drag-and-drop and TC's copy/move commands work uniformly across the plugin namespace: dropping a folder onto another folder relocates every session inside. Behind the scenes this is the same code path as F6, so jump-host references are kept consistent.

Moving a Session to Another Machine

Copying a session out of the plugin writes a small INI file describing it, and dropping such a file back onto the plugin creates the session again. If the session goes through a proxy, the proxy travels with it: on the way back an identical proxy already on the machine is reused, and only a proxy never seen before is added to your list. Either way the session ends up pointing at the right one, whatever number it happens to have locally.

Two things do not travel, by design: the password of the session and the password of its proxy. Both are tied to the machine that stored them. You are asked for them on the first connection.

A file written by an older version of the plugin names a proxy without describing it. Such a session is imported without a proxy and says so, rather than being pointed at whichever proxy happens to hold that number here.

Session Storage

Storage Location

  • Sessions stored in sftpplug.ini
  • Located in Total Commander configuration directory
  • Typically: %APPDATA%\GHISLER\ or TC installation directory

Stored Information

  • Hostname and port
  • Username
  • Encrypted password (if saved)
  • Transfer mode settings
  • Proxy configuration
  • Codepage/encoding settings
  • Key file paths
  • Advanced options (compression, shell transfer, etc.)
  • LAN Pair role, peer, and timeout
  • Jump Host / ProxyJump settings

Password Security

  • Passwords encrypted with Windows DPAPI
  • Encryption is user-specific (cannot be used by other users)
  • Passwords not stored in plain text
  • Optional: Don't save password, prompt each time

Import Sessions

Sessions from other programs appear in the [Imports] folder in the plugin root, one subfolder per source program. Nothing in the source program is modified.

Supported sources

  • SecureCRT — %APPDATA%\VanDyke\Config\Sessions\
  • PuTTY — HKCU\Software\SimonTatham\PuTTY\Sessions, or a putty.reg export
  • WinSCP — HKCU\Software\Martin Prikryl\WinSCP 2\Sessions, or a portable WinSCP.ini
  • FileZilla — %APPDATA%\FileZilla\sitemanager.xml
  • KiTTY — common install locations, or any Sessions\ folder you point the plugin at

Using an imported session

  • Enter — connect straight away, using the settings read from the source program
  • F5 — copy into your own session list; select several first, or Ctrl+A for all of them
  • [Refresh] inside a source folder — pick up sessions added or renamed in the source program
  • [Add custom location...] — point the plugin at a portable install or a backup folder

Passwords

  • KiTTY and FileZilla passwords are carried over when the source has one saved
  • PuTTY keeps no password on disk; WinSCP and SecureCRT passwords are not imported
  • Imported passwords are re-protected with Windows DPAPI, never stored in plain text

Key File Compatibility

  • Key paths preserved as-is, with environment variables resolved
  • Supports .pem, .ppk, and OpenSSH keys with no extension
  • PPK v2, PPK v3 (Argon2) and ed25519 converted natively — no external puttygen needed

See Import sessions from other programs for full details.

After Import Checklist

  1. Open imported session with Alt+Enter
  2. Verify transfer mode matches server capabilities
  3. Check proxy settings if applicable — proxy definitions are not imported
  4. Verify key file paths are valid
  5. Test connection
  6. Adjust SCP/Shell options for restrictive hosts

Session Organization Tips

Naming Conventions

production-server1      - Clear environment prefix
dev-db-backup           - Purpose in name
clientname-project      - Client/project based
aws-eu-west-web         - Cloud provider + region

Session Groups

Use naming patterns for logical grouping:

  • Sessions appear alphabetically in the panel listing
  • Prefix with category for grouping
  • Example: AWS-, Azure-, Local-

Session Limits

  • No hard limit on number of sessions
  • Practical limit: INI file size (typically fine for hundreds)
  • Each session ~500-1000 bytes in INI

Troubleshooting

Session not saved

  • Check INI file is writable
  • Verify Total Commander has write permissions
  • Check disk space

Password not remembered

  • Ensure "Save password" was selected
  • DPAPI requires same Windows user
  • Re-enter password and save again

Import fails

  • Verify source sessions exist in registry (PuTTY/WinSCP) or in the correct folder (Portable/KiTTY)
  • Check registry permissions for registry-based sources
  • For KiTTY Portable: ensure the folder contains a Sessions subdirectory with session files
  • Run Total Commander as administrator if needed
Tip: Export your sftpplug.ini periodically for backup. Sessions are portable between machines (passwords require same Windows user).

Back to index

Character Encoding

The plugin handles character encoding for filenames and file contents. Proper encoding settings ensure correct display of non-ASCII characters.

Filename Encoding

UTF-8 Detection

The plugin can auto-detect server filename encoding:

  • Auto-detect: Plugin tries UTF-8 first, falls back to ANSI if needed
  • Force UTF-8: Always interpret filenames as UTF-8
  • Force ANSI: Use system codepage (e.g., Windows-1250, Windows-1251)

Supported Codepages

For ANSI mode, the following codepages are supported:

  • Windows: 1250 (Central European), 1251 (Cyrillic), 1252 (Western), 1253 (Greek), 1254 (Turkish), 1255 (Hebrew), 1256 (Arabic), 1257 (Baltic), 1258 (Vietnamese)
  • Asian: 932 (Japanese), 936 (Simplified Chinese), 949 (Korean), 950 (Traditional Chinese)
  • Other: 437 (DOS US), 850 (DOS Multilingual), 874 (Thai), 20866 (KOI8-R)

Transfer Mode

Binary Mode

Raw byte transfer without modification. Use for:

  • Executable files
  • Archives (ZIP, RAR, 7z)
  • Images, audio, video
  • Most modern text files (UTF-8, UTF-16)

ASCII Mode

Converts line endings during transfer:

  • Upload: LF → CRLF (Unix → Windows)
  • Download: CRLF → LF (Windows → Unix)
  • Use for: Plain text files, scripts, configs

Auto Mode

Uses wildcard patterns to determine transfer mode automatically.

Text File Type Patterns

Configure which files use ASCII mode:

  • Default patterns: *.txt;*.log;*.ini;*.cfg;*.xml;*.json
  • Multiple patterns separated by semicolons
  • Wildcards supported: * (any), ? (single char)
  • Case-insensitive matching

Pattern Examples

*.txt;*.log;*.ini          - Common text files
*.c;*.h;*.cpp;*.hpp        - Source code files
*.md;*.rst;*.adoc          - Documentation files
*.htm;*.html;*.css;*.js    - Web files

Line Ending Detection

The plugin can auto-detect line ending format:

  • LF (Unix): 0x0A - Linux, macOS, modern Windows tools
  • CRLF (Windows): 0x0D 0x0A - Traditional Windows
  • CR (Classic Mac): 0x0D - Legacy Mac (pre-OS X)

UTF-8 BOM Handling

The plugin preserves UTF-8 BOM (Byte Order Mark) during transfers:

  • BOM detected at file start
  • Preserved during binary transfer
  • Handled correctly in ASCII mode

Unicode in Paths

Full Unicode support for:

  • Local paths (Windows UTF-16)
  • Remote paths (UTF-8 or configured codepage)
  • Session names (stored in INI as UTF-8)

Common Issues

Garbled filenames after transfer

  • Check UTF-8 setting matches server configuration
  • Try forcing UTF-8 or forcing ANSI
  • Verify correct codepage for ANSI mode

Text files have wrong line endings

  • Ensure file matches text pattern for ASCII mode
  • Check if file is actually UTF-16 (needs binary)
  • Use binary mode for mixed-encoding files

Asian characters display incorrectly

  • Use UTF-8 mode if server supports it
  • Select correct Asian codepage (932/936/949/950)
  • Ensure system has appropriate fonts installed
Best practice: Modern servers typically use UTF-8. Start with UTF-8 auto-detect, then adjust if you see encoding issues.

Back to index

Import from PuTTY / WinSCP / FileZilla / KiTTY / SecureCRT / OpenSSH

The plugin can read the session lists of other SSH and file-transfer programs and show them as ready-to-use entries. Nothing in the source program is modified — the plugin only reads.

The [Imports] folder

Open the plugin in Total Commander. Alongside your own saved sessions you will see a folder named [Imports]. It appears automatically as soon as at least one supported program is detected on the machine, or after you add a portable location by hand.

Inside [Imports] there is one folder per source program:

[Imports]
├── [SecureCRT]
├── [PuTTY]
├── [WinSCP]
├── [FileZilla]
├── [KiTTY]
└── [OpenSSH]

Only the programs that were actually found are listed.

Inside a source folder

Each source folder holds the sessions found for that program, plus a few command entries:

EntryWhat it does
[Refresh]Re-reads the source program and updates the list on demand. Changes show by themselves the next time you open the folder, in the auto-detected location and in the ones you added.
[Add custom location...]Point the plugin at a portable installation, a backup folder, or a USB stick in addition to the auto-detected location.
[Manage custom locations]Lists the locations you added. F8 removes one and drops only the sessions that came from it.
A sessionEnter connects. F5 copies it into your own session list.

Two ways to use an imported session

Connect directly (Enter)

Press Enter on a session and the plugin connects using the settings read from the source program. Nothing is written to your own configuration — the entry stays a live view of the other program's session. If you later change the session in PuTTY, the change is picked up the next time you open the folder. A host key you confirmed for such a session is kept across that re-read as long as the host stays the same.

Make it your own (F5)

Select one or more sessions and press F5 (or drag them) onto the other panel showing the plugin root. They are written into your sftpplug.ini as ordinary saved sessions and from then on behave like any session you created yourself — you can edit them with Alt+Enter, rename with F6, put them in folders.

To copy every session of a source at once, enter its folder, press Ctrl+A (or Num *) and then F5.

F5 onto a real filesystem path writes a portable INI snippet instead, which you can carry to another machine and drop back onto the plugin root.

Where each source is looked for

SourceAuto-detected locationCustom location accepts
SecureCRT %APPDATA%\VanDyke\Config\Sessions\ Any folder holding a SecureCRT session tree
PuTTY HKCU\Software\SimonTatham\PuTTY\Sessions
(also used by ExtraPuTTY, PuTTY CAC, mtPuTTY, SuperPuTTY)
A putty.reg export file
WinSCP HKCU\Software\Martin Prikryl\WinSCP 2\Sessions A portable WinSCP.ini
FileZilla %APPDATA%\FileZilla\sitemanager.xml Any sitemanager.xml
KiTTY %APPDATA%\KiTTY\Sessions\, %LOCALAPPDATA%\KiTTY\Sessions\, %USERPROFILE%\KiTTY\Sessions\, or the folder registered for the .kitty file association The Sessions\ folder, or the KiTTY install root — the plugin steps into Sessions\ by itself
OpenSSH %USERPROFILE%\.ssh\config (where OpenSSH for Windows keeps it) Any OpenSSH client config file
OpenSSH config. Every concrete Host name is a session; patterns such as Host 10.* or Host * are not listed but their values apply to the hosts they match, the first value found winning, exactly as ssh myserver resolves them. Read: HostName, Port, User (your Windows user name when absent, as ssh does), the first IdentityFile, ProxyJump with one hop, and Include. Match blocks are skipped. A ProxyCommand or a chain of jump hosts is refused. The config stays the place the settings live: Enter connects with what it says, and an edit to the config or to any file it includes shows the next time you open [OpenSSH].
KiTTY is portable by design and has no fixed install path. If you unpacked it somewhere the probes do not cover — a Downloads folder, a second drive, a USB stick — the source folder stays empty until you add the location through [Add custom location...].

Which sessions appear

Only sessions the plugin can actually open are listed. Entries using a protocol outside SSH/SFTP/SCP are filtered out:

  • SecureCRT — non-SSH2 sessions are skipped.
  • PuTTY / KiTTY — only Protocol=ssh.
  • WinSCP — SFTP and SCP sessions are kept; FTP, WebDAV and S3 are skipped. Saved window layouts (Workspaces) are not sessions and never appear.
  • FileZilla — only SFTP sites; FTP, FTPS, WebDAV and S3 are skipped.

Template rows the source programs keep for their own defaults (Default Settings) are filtered out everywhere.

What is carried over

SettingSecureCRTPuTTYWinSCPFileZillaKiTTYOpenSSH
Host and portyesyesyesyesyesyes
User nameyesyesyesyesyesyes
Key fileyesyesyesyesyesyes
SSH agent—yesyes—yes—
File name encodingyesyes—yesyesUTF-8
Line endings—yesyes—yesUnix
SCP transport——yes———
Password———partlyyes—
Proxy (HTTP, SOCKS4, SOCKS5)on copyon copyon copyon copyon copy—
Jump host / tunnelyesyesyes—refusedyes

Folder structure is preserved: a WinSCP session in a folder, a FileZilla site inside a <Folder>, or a SecureCRT session in a subdirectory all show up as nested folders in the panel.

Passwords

Whether a password comes across depends on how the source program stores it, and on whether saving it was a deliberate choice by the user:

  • PuTTY — nothing to import; PuTTY does not keep a password on disk at all.
  • WinSCP and SecureCRT — not imported. You are asked for the password on the first connection, or you can save one through the plugin's own connection dialog.
  • FileZilla — imported when the site uses Save password. Sites protected by a FileZilla master password are skipped and you are prompted instead.
  • KiTTY — imported. Ticking Save password in KiTTY is an explicit action, so the value is carried over.
  • OpenSSH — nothing to import; the config holds no passwords.

Whenever a password is imported it is re-protected with Windows DPAPI before being stored, exactly like a password you type into the plugin yourself. Nothing is written in plain text.

Key files

  • Paths are taken over as they are, with %ENVIRONMENT% variables resolved.
  • .ppk keys are converted on the fly — PPK v2, PPK v3 (Argon2) and ed25519 all work, no external puttygen needed.
  • OpenSSH keys are used directly, including files with no extension such as id_rsa or id_ed25519, which FileZilla and KiTTY commonly reference.
  • After importing from a portable installation, check that the key path still points somewhere valid on this machine.

The session list is cached

Session lists are stored next to sftpplug.ini so they are available immediately when Total Commander starts, without re-scanning anything. Consequences worth knowing:

  • Changes you make in the source program become visible the next time you open its folder: the plugin notices that the files or registry keys changed and re-reads them, the locations you added included.
  • If a source becomes temporarily unreachable — a USB stick unplugged, a network share offline — its sessions stay listed rather than disappearing. They are removed only when the source is reachable and genuinely empty.

Proxies, jump hosts and tunnels

A session that reaches its host through a proxy, a jump host or a tunnel in the source program is never connected without it: going straight to the target would look like success while quietly skipping what was put in the way. What happens depends on whether the plugin can rebuild the dependency:

  • An HTTP, SOCKS4 or SOCKS5 proxy from PuTTY, KiTTY, WinSCP, FileZilla or SecureCRT comes along when you copy the session with F5 — into your own session list, or out to a file. FileZilla has one proxy for the whole program, so it comes along with every site that does not bypass it. SecureCRT keeps its proxies as firewall records, and the record the session names is the one that comes along. The copy points at a proxy in [Proxies]: an existing one when the type, address and user name match, otherwise a new one. The proxy password is not carried over; you are asked for it on the first connection if the proxy needs one. Pressing Enter on the session inside [Imports] still refuses and says to copy it first, since connecting has no business creating proxy records.
  • A jump host — a WinSCP tunnel, a SecureCRT session firewalled through another session, a PuTTY session using SSH to proxy and use port forwarding — becomes the session's jump host. It works straight from [Imports] and comes along on F5. When PuTTY names a saved session as the proxy host, that session's address, user and key are used. The jump host's password is not carried over; you are asked for it on connect unless a key gets in.
  • Anything else — a jump host that itself goes through a proxy or another jump host, a WinSCP tunnel combined with a proxy, a proxy run by a command (Telnet, local command), a SecureCRT firewall record that no longer exists — is refused on Enter and on copying into your session list, with a message naming what is missing. F3 still shows the settings: the file names the missing route in an unsupportedroute= line, and dropping that file back onto the plugin is refused while the line is there.

Not carried over

Host key fingerprints are not inherited — the plugin asks you to confirm the fingerprint on the first connection, as it does for any new host.

Back to index

Plugin Configuration (sftpplug.ini)

Plugin-wide settings that are not part of individual sessions are stored in the [Configuration] section of sftpplug.ini.

File location

Total Commander stores plugin ini files in its configuration directory, typically:

C:\Users\YourName\AppData\Roaming\GHISLER\sftpplug.ini

The exact path depends on how TC was installed:

TC installation typeTypical sftpplug.ini location
Standard install (per-user)C:\Users\YourName\AppData\Roaming\GHISLER\sftpplug.ini
Standard install (all users)C:\ProgramData\GHISLER\sftpplug.ini
Portable / USB install<TC folder>\sftpplug.ini
Tip: In Total Commander, open Configuration → Options → General — the path shown next to wincmd.ini is the TC configuration directory. sftpplug.ini is in the same folder.

If sftpplug.ini does not exist yet, the plugin copies a template (sftpplug.tpl) from the plugin directory on first run. You can also create the file manually.

Configuration keys

KeyDefaultDescription
Language (follows TC) Overrides the plugin UI language. See Language override below.

Language override

By default the plugin detects the language from Total Commander's own setting (wincmd.ini → LanguageIni). The Language= key overrides this detection.

Use it in two situations:

  • TC uses an unsupported language — the plugin supports 15 languages. If TC is set to a language not in that list (e.g. Finnish, Turkish, Arabic, Norwegian, Hebrew), the plugin falls back to English. Use Language= to pick the closest available language instead.
  • Wrong language detected — if TC uses a custom or community language file whose filename the plugin cannot identify (e.g. the plugin shows Chinese characters instead of your language), force the correct language here.

Built-in languages

LanguageAccepted values for Language=
EnglishEnglish, en, enu
PolishPolish, pl, pol
GermanGerman, de, deu
FrenchFrench, fr, fra
SpanishSpanish, es, esp
ItalianItalian, it, ita
RussianRussian, ru, rus
CzechCzech, cs
HungarianHungarian, hu
JapaneseJapanese, ja
DutchDutch, nl
Portuguese (Brazil)Portuguese, pt-br, ptb
RomanianRomanian, ro
SlovakSlovak, sk
UkrainianUkrainian, uk
Chinese (Simplified)Chinese, zh-cn, chs
Example — force English: Open sftpplug.ini in a text editor, find or create the [Configuration] section, and add the Language= line:
[Configuration]
Language=English
Restart Total Commander for the change to take effect.

Custom translation file

If your language is not in the list above, you can create a custom .lng file:

  1. Find the plugin directory — it contains the plugin DLL (sftpplug.wfx / sftpplug.wfx64) and a language\ subfolder.
  2. Copy one of the existing .lng files from the language\ subfolder as a starting point, for example:
    copy language\deu.lng → language\fin.lng
  3. Open language\fin.lng in a UTF-8 text editor (e.g. Notepad++). Each line has the format:
    # This is a comment (ignored)
    12345=Translated string here
    12346=Another string
    Translate the strings on the right side of each =. Leave the numeric IDs on the left unchanged. Lines starting with # are comments.
  4. Save the file as UTF-8 (with or without BOM — both are accepted).
  5. Add to sftpplug.ini:
    [Configuration]
    Language=fin
  6. Restart Total Commander.
Partial translations are fine. Any string ID not present in the .lng file will fall back to English automatically. You only need to translate the strings you care about.

Back to Settings Reference  |  Back to index

Troubleshooting

Wrong credentials for PHP Agent

  • Verify password in connection options.
  • Re-save session to regenerate local sftp.php.
  • Upload regenerated sftp.php again.

PHP Agent endpoint not found (HTTP 404)

  • Check URL path and filename.
  • Ensure server URL points to uploaded sftp.php.

PHP Agent not configured (HTTP 503)

  • Server script has no valid auth constants/environment values.
  • Deploy freshly generated script from plugin directory.

LIST/GET/PUT failures

  • Check server open_basedir, upload limits, and file permissions.
  • Verify current working path and root restrictions.
  • Enable detailed log for diagnostics.

TAR batch download returns 0 files

  • Upload the current sftp.php from the plugin directory — old versions do not have TAR_PACK support.
  • If server still returns 0 files, verify the connection URL matches the deployed script location exactly.

HTTP 504 Gateway Timeout on TAR download (OVH / home.pl)

  • Upload the current sftp.php — the updated version streams directly without buffering and avoids server-side timeouts.

TAR upload fails for large directories

  • Update the plugin to the current build — older builds had a 4 GB limit due to a 32-bit integer overflow.

CHM does not open

  • If file comes from internet, open file properties and click Unblock.
  • Keep sftpplug.chm local, next to plugin DLL.

Back to index

Advanced Troubleshooting

Comprehensive guide for diagnosing and resolving connection and transfer issues.

Connection Problems

Cannot Connect to Host

Symptoms

  • "Connection refused" error
  • "Network is unreachable"
  • Timeout waiting for response

Diagnosis Steps

  1. Verify host is reachable:
    ping hostname
  2. Check SSH port is open:
    telnet hostname 22
    Or:
    Test-NetConnection hostname -Port 22
  3. Verify hostname format:
    • No protocol prefix needed: example.com not ssh://example.com
    • Custom port: example.com:2222
    • IPv6: [::1]:22
  4. Check firewall rules:
    • Windows Firewall may block outgoing SSH
    • Corporate firewall may block port 22
    • Try alternative port if available

Connection Times Out

Common Causes

  • Network latency or packet loss
  • Server under heavy load
  • Intermediate firewall dropping packets
  • MTU issues on network path

Solutions

  • Increase connection timeout in settings
  • Enable SSH keepalive
  • Try from different network
  • Contact server administrator

Connection Reset by Peer

Symptoms

  • Connection established then immediately closed
  • "Connection reset by peer" error

Causes

  • Server rejected authentication method
  • Max connections exceeded on server
  • Server configuration issue
  • Incompatible SSH protocol version

Solutions

  • Check server logs for rejection reason
  • Try different authentication method
  • Wait and retry (may be rate limiting)
  • Verify server supports SSH 2.0

Authentication Problems

Password Authentication Fails

Check These

  • Password is correct (case-sensitive)
  • Account is not locked
  • Password hasn't expired
  • Server allows password authentication

Server Configuration

Some servers disable password auth:

# In /etc/ssh/sshd_config
PasswordAuthentication yes  # Must be enabled

Public Key Authentication Fails

Verify Key Setup

  1. Public key on server:
    cat ~/.ssh/authorized_keys
    Ensure your public key is present
  2. Permissions on server:
    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/authorized_keys
        
  3. Private key format:
    • PEM: OpenSSH format
    • PPK: PuTTY format (native conversion)
    • Check key file is not corrupted
  4. Key passphrase:
    • Enter when prompted
    • Use Pageant to cache unlocked key

PPK Conversion Issues

  • PPK v3 requires argon2.dll: Ensure DLL is in plugin directory
  • Corrupted PPK: Try opening in PuTTYgen
  • Wrong format: Plugin auto-detects, but may fail with unusual keys

Pageant Not Working

Checklist

  • Pageant is running (check system tray)
  • Key is loaded in Pageant (right-click → View Keys)
  • "Use SSH agent (Pageant)" is checked in plugin
  • Plugin can communicate with Pageant

Debug Pageant

  1. Open Pageant key list
  2. Note key fingerprint
  3. Enable detailed logging in plugin
  4. Check which keys plugin sees
  5. Verify server accepts that key type

SFTP/SCP Problems

SFTP Subsystem Not Available

Symptoms

  • "Subsystem request failed"
  • "SFTP initialization failed"

Solutions

  1. Try SCP mode instead
  2. Enable "Use SCP for everything"
  3. Enable shell transfer fallback
  4. Contact admin to enable SFTP subsystem

Server Configuration

# In /etc/ssh/sshd_config
Subsystem sftp /usr/lib/openssh/sftp-server  # Must be present

SCP Transfers Fail

Common Issues

  • Permissions: No write permission in target directory
  • Disk space: Server disk full
  • File size: Exceeds server limits
  • Filename encoding: Non-ASCII names

SCP Protocol Issues

  • Some servers have buggy SCP implementation
  • Try "Use SCP for data transfers" (mixed mode)
  • Enable shell transfer as fallback

Transfer Speed Slow

Diagnosis

  • Check network bandwidth: speed test
  • Monitor CPU usage (compression overhead)
  • Check server load
  • Test with different file sizes

Optimization

  • Disable compression: May help on fast networks
  • Increase block size: Larger transfers more efficient
  • Use binary mode: ASCII conversion adds overhead
  • Parallel transfers: Multiple small files

PHP Agent Problems

HTTP 401 Unauthorized

Causes

  • Password doesn't match PSK in sftp.php
  • An old sftp.php on the server, generated for a different password
  • A proxy or CDN in front of the server drops the X-SFTP-* headers that carry the signature

Solutions

  1. Regenerate sftp.php with correct password
  2. Upload new sftp.php to server
  3. Make sure custom request headers reach PHP unchanged

HTTP 404 Not Found

Check

  • URL is correct and complete
  • sftp.php exists at that path
  • File permissions allow execution
  • Web server configured for PHP

Test URL

curl -I https://example.com/sftp.php
Should return HTTP 200 or 401 (not 404)

HTTP 503 Service Unavailable

Meaning

  • AGENT_PSK not configured
  • sftp.php not properly deployed

Fix

  1. Set PSK via environment variable:
    export AGENT_PSK=your_secret
  2. Or edit sftp.php constant:
    const AGENT_PSK = 'your_secret';
  3. Re-upload sftp.php

Upload Fails with HTTP 500

Check PHP Limits

  • upload_max_filesize in php.ini
  • post_max_size in php.ini
  • max_execution_time
  • memory_limit

Check Server Logs

# Apache
tail -f /var/log/apache2/error.log

# Nginx
tail -f /var/log/nginx/error.log

# PHP
tail -f /var/log/php/error.log

Directory Listing Empty

Possible Causes

  • AGENT_ROOT set incorrectly
  • open_basedir restriction
  • Directory permissions
  • SELinux/AppArmor blocking

Debug

# Check what PHP sees
php -r "var_dump(scandir('.'));"

Character Encoding Issues

Garbled Filenames

Diagnosis

  • Note which characters are wrong
  • Check server's default encoding
  • Try forcing UTF-8 or ANSI

Solutions

  • Set UTF-8 for filenames
  • Select correct codepage for ANSI
  • Check server SSH configuration

Text File Content Corrupted

Check Transfer Mode

  • Binary: Raw bytes (no conversion)
  • ASCII: Line ending conversion
  • Auto: Based on file patterns

Line Ending Issues

  • Windows expects CRLF
  • Unix expects LF
  • Classic Mac used CR
  • Use appropriate mode for target

Proxy Issues

Proxy Connection Fails

Verify Proxy Settings

  • Proxy hostname correct
  • Proxy port correct
  • Proxy type matches server
  • Credentials if required

Test Proxy

# HTTP proxy
curl --proxy http://proxy:8080 https://example.com

# SOCKS proxy
curl --socks5 proxy:1080 https://example.com

SOCKS5 Authentication Fails

Check

  • Username/password correct
  • SOCKS5 selected (not SOCKS4a)
  • Proxy supports username/password auth

Logging and Debugging

Enable Detailed Logging

  1. Check "Detailed log" in plugin settings
  2. Check "Show entire directory listings in log"
  3. Reproduce the issue
  4. Review Total Commander log window

Log Analysis

Connection Log

CONN: Connecting to hostname:22
CONN: Socket connected
CONN: SSH session initialized
CONN: Server banner: SSH-2.0-OpenSSH_8.9
CONN: Userauth list: publickey,password

Transfer Log

XFER: Downloading /remote/file.txt
XFER: Size: 1234567 bytes
XFER: Using SFTP method
XFER: Progress: 50%
XFER: Complete

Network Capture

For advanced debugging, use Wireshark:

  1. Start capture on network interface
  2. Filter: tcp.port == 22
  3. Reproduce issue
  4. Stop capture and analyze

Recent Bug Fixes (March 2026)

PHP Agent TAR batch download — 0 files received

Symptom: Downloading multiple files with TAR stream enabled completes without error but writes 0 local files.

Cause: Remote path passed to TarDownloadSessionQueue included the host prefix and script path (e.g. host.example.com/sftp.php/dir/file.txt), so the lookup key never matched the TAR entry names returned by the server.

Fix: NormalizePhpRemotePath is now applied inside TarDownloadSessionQueue before building the lookup map. Update to the latest plugin build.

PHP Agent TAR batch download — HTTP 504 Gateway Timeout (OVH / home.pl)

Symptom: TAR download of large file sets times out with HTTP 504 on shared hosting servers.

Cause: The server-side op_tar_pack buffered the entire TAR archive in php://temp before sending any response bytes. Servers like OVH and home.pl abort PHP scripts that produce no output for several seconds.

Fix: op_tar_pack now streams directly to php://output with output buffering disabled (ob_end_clean, zlib.output_compression=0, X-Accel-Buffering: no). Upload the updated sftp.php from the plugin directory to your server.

PHP Agent TAR upload — silent failure for archives exceeding 4 GB

Symptom: Uploading a large directory whose TAR archive exceeds 4 GB fails silently — no error shown, but files are not transferred.

Cause: WinHttpSendRequest was called with (DWORD)totalTarSize as the dwTotalLength parameter. DWORD is 32-bit; values above 4 294 967 295 bytes wrap around, causing WinHTTP to send a false Content-Length and the server to close the connection mid-stream.

Fix: Content-Length is now added as a 64-bit string to the custom headers and WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH is passed as dwTotalLength. Update to the latest plugin build.

SFTP Resume Not Working

Symptom: Resume upload always starts from beginning instead of last position.

Cause: Missing LIBSSH2_SFTP_ATTR_SIZE flag in fstat request.

Fix: Added flag to request file size from server. Update to latest version.

Setstat After SCP Upload

Symptom: Potential crash when setting timestamps after SCP upload in SCP-only mode.

Cause: Missing null check for sftpsession before calling setstat.

Fix: Added guard to check sftpsession != nullptr. Update to latest version.

Tilde Symlink Downloaded as File

Symptom: Clicking "~" (home symlink) opens download dialog instead of opening folder.

Cause: Stale shell session after PHP→SCP mode switch, TC interpreted FS_EXEC_YOURSELF as "download file".

Fix: Added reconnect+retry logic and safety net in FsGetFileW. Update to latest version.

Diagnostic Log

The plugin keeps no log unless asked to. To record one for a bug report, add DebugLog=1 to the [Configuration] section of sftpplug.ini (or set the environment variable SFTPPLUG_DEBUGLOG=1) and restart Total Commander.

The log goes to %LOCALAPPDATA%\SFTPplug\sftpplug.log, a folder of your own user profile. It leaves out passwords and key material. Remove the setting again once the log is recorded: logging slows transfers down.

Getting Help

Information to Provide

  • Plugin version
  • Total Commander version
  • Windows version
  • Server type and version
  • Detailed error messages
  • Log output (with sensitive data removed)
  • Steps to reproduce

Common Error Codes

CodeMeaning
LIBSSH2_ERROR_SOCKET_NONE (-2)Socket not initialized
LIBSSH2_ERROR_BANNER_RECV (-3)Server banner not received
LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE (-4)KEX failed
LIBSSH2_ERROR_TIMEOUT (-10)Operation timed out
LIBSSH2_ERROR_AUTHENTICATION_FAILED (-18)Auth failed
LIBSSH2_ERROR_SFTP_PROTOCOL (-26)SFTP protocol error
LIBSSH2_ERROR_SOCKET_DISCONNECT (-13)SSH disconnected
Tip: Many issues are server-side. Check server logs (/var/log/auth.log, /var/log/secure) for SSH daemon messages.

Back to index

Transfer Resume

The plugin supports resuming interrupted transfers in SFTP mode and partially in Shell Fallback mode. Resume behavior differs depending on the active transfer method.

SFTP (primary mode) — full resume support

SFTP resume works for both downloads and uploads.

Download resume

  1. Total Commander detects that a partial local file already exists at the destination.
  2. TC passes a resume flag to the plugin.
  3. The plugin queries the remote file size via SFTP fstat (with the ATTR_SIZE flag set — required for correct size retrieval).
  4. The remote file handle is seeked to the end of the already-downloaded portion.
  5. Transfer continues from that offset.

Upload resume

  1. TC detects a partial remote file.
  2. The plugin opens the remote file for append and seeks to its current end.
  3. Upload continues from the local file offset matching the remote file size.
Note: Resume requires that the remote file has not been modified or truncated since the interrupted transfer. If the remote file size does not match the expected partial size, TC will prompt you to overwrite or skip.

SCP (native) — no mid-transfer resume

The SCP protocol does not support seeking into a remote file. If an SCP transfer is interrupted:

  • The transfer must restart from the beginning.
  • TC will prompt you to overwrite the partial destination file.
  • If you need resume support for large files on a server that only supports SCP, consider switching to Shell Fallback (base64) or requesting SFTP subsystem access from the server administrator.

Shell Fallback (base64) — chunked resume

Shell fallback transfers data in base64-encoded 1024-byte chunks. Resume is possible at chunk boundaries.

  • Base64 encoding works in groups of 3 bytes → 4 characters. Chunks are kept at multiples of 3 bytes (≤ 1024 bytes) so that resume always lands on a valid base64 boundary.
  • On resume, the plugin calculates the nearest safe boundary below the partial file size and restarts from there.
  • A small overlap (up to 3 bytes) may be re-transferred, which is harmless.
Performance note: Shell fallback is significantly slower than SFTP or SCP due to base64 encoding overhead and shell command round-trips. Use it only when SFTP and SCP are both unavailable on the server.

PHP Agent — no resume

PHP Agent single-file transfers (GET/PUT operations) do not support partial resume. If interrupted, the transfer must restart from the beginning — this is a limitation of the HTTP chunked transfer model used by the agent.

PHP Agent TAR stream transfers (directory download via TAR_STREAM, batch upload via TAR_EXTRACT) also do not support resume. The entire TAR stream must complete in one HTTP request. If a TAR transfer is interrupted, re-copy the whole directory.

LAN Pair — full resume support

LAN Pair file transfers support resume at the session protocol level. If the session times out or the connection drops mid-transfer, you can reconnect and resume using TC's standard resume prompt.

Summary

ModeDownload resumeUpload resumeNotes
SFTPYesYesFull seek support via libssh2
SCP (native)NoNoProtocol limitation
Shell FallbackPartialPartialChunk-boundary resume only
PHP AgentNoNoHTTP transfer model limitation
LAN PairYesYesSession-level resume

Back to index