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:
| Port | Protocol | Purpose |
| 45845 | UDP (broadcast) | Peer discovery — both machines announce themselves on the local network every 2 seconds |
| 45846 | TCP | Pairing 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:
- 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.
- Once both sides have proved the key, each stores it encrypted with Windows DPAPI, for that peer.
- 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:
- The local file server starts listening on TCP 45846 in the background.
- A 60-second countdown dialog appears: "Searching for LAN Pair peer on local network...". You can cancel at any time.
- 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.
- 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
- Create or edit a session and set Transfer = LAN Pair.
- Set the session name. This name is also shown as the visible peer label on the other machine.
- Choose Auto, Receiver, or Donor in the role dropdown.
- Optional: set Session timeout in minutes.
0 means no limit.
- Click Pair....
- Enter the pairing password — the same on both computers. Pairing does not start without one.
- 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
- 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.
- While impersonating TrustedInstaller, all file operations (read, write, delete, rename, mkdir) run with TrustedInstaller privileges, bypassing the normal ownership restrictions.
- 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:
| Key | Values | Description |
transfermode | 3 | Fixed value for LAN Pair mode |
server | lanpair://peer/PEERNAME | Peer identifier URI |
lanpairrole | 0 / 1 / 2 | 0 = Auto, 1 = Receiver, 2 = Donor |
lanpairpeer | peer name string | Name of the target peer as seen in the discovery list |
lanpairtimeout | integer ≥ 0 | Session timeout in minutes; 0 = no limit |
lanparti | 0 / 1 | 1 = 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
| Problem | Likely cause | Fix |
| Peers not found | Windows Firewall blocking UDP 45845 or machines on different subnets | Allow UDP 45845 inbound in Windows Firewall; verify both machines are on the same network segment |
| Connection refused | Windows Firewall blocking TCP 45846 | Allow 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 password | Pair 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 protocol | Update the plugin on both computers |
| Peers found but classic SMB works — LAN Pair does not | UDP 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 modified | TrustedInstaller option not enabled, or TC not running with SeDebugPrivilege | Enable 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 read | The key was saved under a different Windows account or on another installation | Nothing 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