|
Command Line Proxy Support
The command line sftp and ssh clients can be used to connect through a proxy server using the proxyCommand ssh option. Both ssh and SOCKS proxy are supported.
SSH proxy
SSH proxy can be used by calling a secondary ssh connection to the proxy server.
-oProxyCommand="ssh -W %h:%p proxy_server"
SOCKS proxy
Connection through a SOCKS proxy can be done using the connect.exe tool, included with the server and client packages.
-oProxyCommand="connect -S proxy-server:port sftp_server 22"
Troubleshooting Proxy Connection
Try connecting through the proxy server alone using just the connect command. Open a command prompt and type "connect -S proxy-server:port destination_server 22". The server should respond with the destination server version string. Once this command works, copy/paste the command as the proxyCommand option to the ssh/sftp client.
USAGE:
connect [-dnhst45] [-p local-port]
[-H proxy-server[:port]] [-S [user@]socks-server[:port]]
[-T proxy-server[:port]]
[-c telnet-proxy-command]
host port
OPTIONS:
|
-d
|
debug connection. Outputs response from server.
|
|
-n
|
connect without any proxy
|
|
-h
|
Use the HTTP_PROXY environment variable for HTTP-proxy host connection
|
|
-s
|
Use the SOCKS5_SERVER environment variable for socks proxy host connection
|
|
-t
|
Use the TELNET_PROXY environment variable for telnet-proxy host connection
|
|
-4
|
Use SOCKS 4 protocol
|
|
-5
|
Use SOCKS 5 protocol (default)
|
|
-p port
|
Local port to use instead of standard port for protocol
|
|
-H HTTP-proxy-server[:port]
|
Use HTTP proxy protocol to connect to HTTP-proxy-server on port port. The default port is 80. The environment variable HTTP_PROXY can be used to assign a global value, which can be used with the -h option.
|
|
-S [user@]socks-proxy-server[:port]
|
Use socks proxy protocol to connect to socks-proxy-server on port port. The default port is 1080. The environment variable SOCKS5_SERVER can be used to assign a global value, which can be used with the -s option.
|
|
-T proxy-server[:port]
|
Use telnet proxy protocol to connect to telnet-proxy-server on port port. The default port is 23. The environment variable TELNET_PROXY can be used to assign a global value, which can be used with the -t option.
|
|
-c telnet-proxy-command
|
Domain of administrative user
|
|
host
|
Destination port after proxy command succeeds
|
|
port
|
Destination port after proxy command succeeds
|
Use proxyCommand in the config file
The proxy command can be defined in the config file as well as the command line. The config file should be stored in the %APPDATA%\PragmaSSH directory of the user running the command line client. The file should contain the command as it is passed on the command line:
proxyCommand=ssh -W %h:%p proxy_server
A host can also be assigned in the config file
Host host-thru-proxy HostName destination_host ProxyComnand ssh -W %h:%p proxy_server
To connect with a proxy connection defined in the config file, use the host defined in the Host line. For example,
ssh host-thru-proxy
|