3yo issue still a problem




Powershell script

Funny thing is, when I select "Remember session password and pass it to PuTTY (SSH)" the password is passed correctly, but it's placed before even invoking (in my case) powershell – see the attachment.
Do someone know if I can modify my invoking command so I can make use of the password passed this way?
This is my PuTTY/Terminal client path:
%ProgramFiles%\WindowsApps\Microsoft.WindowsTerminal_1.18.3181.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe powershell %USERPROFILE%\Documents\winscp.ps1 -rpath1 '!/' -host1 '!@' -user1 '!U' -port1 '!#' -key1 '!K' -name1 '!N'
The red rectangle is the password to SSH connection.

Screenshot 2023-12-05 143407.png

Reply with quote

Site Admin
martin avatar
Prague, Czechia

Re: Powershell script

I'm confused.
  1. There's no !P in your command.
  2. If you do not check "Remember session password and pass it to PuTTY (SSH)", the password won't be passed at all. If you check it, you claim that it is passed "correctly". So when is it passed incorrectly?

Note that if you check "Remember session password and pass it to PuTTY (SSH)", but do not include !P in the command, WinSCP passes -pw password as the first argument of the program (WindowsTerminal.exe in your case). So the behaviour is as expected in that case. If your case, you need to explicitly use -pw "!P" to designate a correct placement of the password in the command.
See https://winscp.net/eng/docs/ui_pref_integration_app#password

If the problem are the special characters, as discussed by the topic you have linked, then I do not understand the point of your post. The other topic shows that it's a problem of PuTTY, not WinSCP.

Though, it might be worth trying WinSCP 6.2, as it can pass the password to PuTTY using named pipe instead of commandline. It might help, at least with some special characters (like quotes).
Again, see https://winscp.net/eng/docs/ui_pref_integration_app#password

Reply with quote


You can post new topics in this forum