HP-UX Secure Shell Getting Started Guide HP-UX 11i v1, HP-UX 11i v2, and HP-UX 11i v3 (5900-3142, June 2013)

Example 4 Connecting to an External Server Using a DanteSOCKS Proxy
Enter the following command to connect to an external server using a DanteSOCKS proxy:
# ssh -o "ProxyCommand connect -S proxy-server %h %p" external-server
The system is connected to external-server through proxy-server.
Example 5 Data Transfer Using a DanteSOCKS Proxy
Enter the following command to transfer data using a DanteSOCKS proxy:
# scp -o "ProxyCommand connect -S proxy-server %h %p" external-server
:remotefile localfile
or
# sftp -o "ProxyCommand connect -S proxy-server %h %p" external-server
The system is connected to external-server using proxy-server, and remotefile is copied. to
localfile.
Dynamic Port Forwarding
You can configure the dynamic port forwarding feature of HP-UX Secure Shell to serve as a SOCKS
server, instead of forwarding from specific ports on the local and remote servers. The dynamic
port forwarding feature in HP-UX Secure Shell replaces the socks proxy. To connect to a SOCKS
server, you need a socks client, or the actual application client must have the socks client feature.
In local and remote port forwarding, the ssh client statically configures the port to which the
application client will connect. However, in dynamic port forwarding, HP-UX Secure Shell provides
an option that enables the application client to choose the port that must be connected in the remote
system dynamically. For example, enter the following command to specify the port number that
ssh must listen on:
# ssh -D <port number> localhost
In the following command, the port to be connected in the remote machine is picked up by %p .
The SOCKS server on the specified <port number> then connects to the port %p running on the
specified host (%h).
# ssh-o "ProxyCommand connect -S proxy-server:<port number> %h %p"
external-server
NOTE: Currently, both the SOCKS4 and SOCKS5 protocols are supported.
Dynamic Port Forwarding Process
Figure 5 (page 51) illustrates the dynamic port forwarding process.
50 Configuring HP-UX Secure Shell as a SOCKS Proxy