-1

WinSCP offers a great option to connect via PuTTY with one button. The only problem, is there is no way to set the port which PuTTY connects to. So if my server uses a custom port (1024), I have to load PuTTY manually and do this connection.

I know WinSCP has some command line parameters that help set this up, listed here: https://winscp.net/eng/docs/integration_putty#session_configuration but I tried adding -p 1024 to the PuTTY.exe path, but it gave me an error

unknown option -p

When I load putty.exe separately I can see a WinSCP Temporary Session Configuration is present in the list. It is set to port 23. When I change this to port 1024 and save, I can log in via telnet by pressing open.

However, when I try to click on the PuTTY button in WinSCP again, it is still unable to connect. And when I open putty.exe the next time, it shows WinSCP Temporary Session is reset back to port 23.

If anyone has a suggestion how I can connect to a custom port through PuTTY when using WinSCP, thank you.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Mich
  • 3,188
  • 4
  • 37
  • 85

3 Answers3

0

Ok it's in Options->Prefernces->Applications, use path

"%ProgramFiles%\PuTTY\putty.exe" -P 1024

Mich
  • 3,188
  • 4
  • 37
  • 85
0

While you can change a global configuration, like your own answer shows, it breaks a connection to all other sessions/servers, which use a standard port.

Better is to create a stored session in PuTTY (with the custom port) matching name of WinSCP stored site. WinSCP, then instead of using its own configuration, instructs PuTTY to open that same-named session.

See https://winscp.net/eng/docs/integration_putty#session_configuration

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
0

ssh root@xxx.xxx.xxx.xxx -P xxx in windows cmd : "C:\Program Files\PuTTY\putty.exe" -ssh root@xxx.xx.xxx.xx -P xxx