3

Any idea how to connect below PuTTY psftp command with proxy authentication (SOCKS5)?

psftp username@host -P portnumber -pw password
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
FIROZ K A
  • 111
  • 4
  • 13

1 Answers1

4

PuTTY and its tools have no command-line arguments to setup a proxy.

You have to pre-configure a stored session with the proxy.

Or of course, you can create an ad-hoc stored site automatically.

set REG_ADD=reg add HKCU\SOFTWARE\SimonTatham\PuTTY\Sessions\AdHoc /f

%REG_ADD% /v HostName /t REG_SZ /d host
%REG_ADD% /v UserName /t REG_SZ /d username
%REG_ADD% /v Protocol /t REG_SZ /d ssh
%REG_ADD% /v PortNumber /t REG_DWORD /d 22
%REG_ADD% /v ProxyMethod /t REG_DWORD /d 2
%REG_ADD% /v ProxyHost /t REG_SZ /d proxy

psftp -load AdHoc -pw password
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • 1
    Very helpful answer Martin! I'd like to add that we can specify the proxy port by `%REG_ADD% /v ProxyPort /t REG_DWORD /d 1080` – Edwin Yip Aug 15 '19 at 10:57
  • The stored session info is only stored for the Current User. This has created some challenges in our case, where the psftp.exe script was executed by a user, which was meant to be non-interactive. – theczechsensation Dec 18 '19 at 17:12