PSM-WinSCP connector error - PSMDU019I [WinSCP Dispatcher - Unexpected button [Open] instead of [Login]] due to WinSCP.ini portable mode
Symptom
When users launch a PSM-WinSCP session via the PVWA, the very first connection attempt succeeds. However, all subsequent connection attempts fail during the initial dispatcher handshake. The connection briefly opens but terminates automatically.
A review of the ClientDispatcher.log for the failed session reveals the following error sequence:
PSMDU019I Dispatcher trace message: [WinSCP Dispatcher - make sure current form is [New Site]]
PSMDU019I Dispatcher trace message: [WinSCP Dispatcher - Currently in an unknown form. Pressing on [New Site]]
PSMDU019I Dispatcher trace message: [WinSCP Dispatcher - make sure target button caption is 'Login']
PSMDU019I Dispatcher trace message: [WinSCP Dispatcher - Unexpected button [Open] instead of [Login]]
PSMDU019I Dispatcher trace message: [WinSCP Dispatcher - Unblock user input]
PSMDU018E Dispatcher error: [WinSCP Dispatcher - New connection dialog could not be found. Closing application.]
Environment
14.2 Privileged Access Manager (PAM, self-hosted) PSMP
- Privileged Access Manager (PAM, self-hosted)
- Privilege Cloud
- PSM (Privileged Session Manager) Connection Component: PSM-WinSCP
Cause
The issue is caused by the presence of a WinSCP.ini configuration file located in the same directory as the WinSCP.exe file (e.g., the PSM Components folder).
By default, the PSM WinSCP dispatcher enforces security by temporarily locking down the shadow user's Windows Registry key for WinSCP (HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2) to Read-Only during the session. This prevents the application from saving connection states, workspaces, or passwords.
However, if a WinSCP.ini file is present, WinSCP defaults to "Portable Mode." It stops referencing the Windows Registry and writes its configuration directly to the INI file instead (e.g., appending AutoSaveWorkspace=1). This entirely bypasses the PSM dispatcher's registry lockdown.
As a result, WinSCP successfully saves the "Workspace" UI state during the first connection. On subsequent launches, WinSCP automatically opens the saved workspace, which features an "Open" button, rather than the default "New Site" screen, which features the expected "Login" button. The dispatcher macro searches for the "Login" button, fails to find it, and securely terminates the session as a failsafe.
Resolution
To resolve this issue, you must remove the configuration file and force WinSCP to use the standard Windows Registry.
- Log in to the PSM server as an Administrator.
- Navigate to the directory where WinSCP.exe is located (typically C:\Program Files (x86)\CyberArk\PSM\Components\ or C:\Program Files (x86)\WinSCP\).
- Locate the WinSCP.ini file. Delete or rename this file.
- Launch WinSCP.exe manually to verify the storage configuration.
- In the WinSCP application, go to Options > Preferences (or click the Tools/Gear icon).
- In the left-hand navigation pane, select Storage.
- Verify that Configuration storage is set to Windows registry (recommended).
- Click OK to save the changes and close WinSCP.
- Initiate multiple test connections via the PVWA to confirm that consecutive sessions now launch successfully without saving the workspace.