The -nc option prevents Plink (or PuTTY) from attempting to start a shell or command on the remote server. Instead, it will instruct the remote server to open a network connection to a host name and port number specified by you, and treat that network connection as if it were the main session.
You specify a host and port as an argument to the -nc option, with a colon separating the host name from the port number, like this:
plink host1.example.com -nc host2.example.com:1234
You might want to use this feature if you needed to make an SSH connection to a target host which you can only reach by going through a proxy host, and rather than using port forwarding you prefer to use the local proxy feature (see
section 4.15.1
for more
about local proxies). In this situation you might select ‘Local’ proxy type, set your local proxy command to be ‘plink %proxyhost -nc %host:%port’, enter the target host name on the Session panel, and enter the directly reachable proxy host name on the Proxy panel.
This feature is only available in SSH protocol version 2 (since the version 1 protocol assumes you will always want to run a shell). It is not available in the file transfer tools PSCP and PSFTP. It is available in PuTTY itself, although it is unlikely to be very useful in any tool other than Plink. Also, -nc uses the same server functionality as port forwarding, so it will not work if your server administrator has disabled port forwarding.
(The option is named -nc after the Unix program
nc
, short for ‘netcat’. The command ‘plink host1 -nc host2:port’ is very
similar in functionality to ‘plink host1 nc host2 port’, which invokes nc on the server and tells it to connect to the specified destination. However, Plink's built-in -nc option does not depend on the nc program being installed on the server.)
3.8.3.15 -C: enable compression
The -C option enables compression of the data sent across the network. This option is only meaningful if you are using SSH.
This option is equivalent to the ‘Enable compression’ checkbox in the SSH panel of the PuTTY configuration box (see
section
4.18.3
).
3.8.3.16 -1 and -2: specify an SSH protocol version
The -1 and -2 options force PuTTY to use version 1 or version 2 of the SSH protocol. These options are only meaningful if you are using SSH.
These options are equivalent to selecting your preferred SSH protocol version as ‘1 only’ or ‘2 only’ in the SSH panel of the PuTTY configuration box (see
section 4.18.4
).
3.8.3.17 -4 and -6: specify an Internet protocol version
The -4 and -6 options force PuTTY to use the older Internet protocol IPv4 or the newer IPv6 for most outgoing connections.
These options are equivalent to selecting your preferred Internet protocol version as ‘IPv4’ or ‘IPv6’ in the Connection panel of the PuTTY configuration box (see
section 4.13.4
).
3.8.3.18 -i: specify an SSH private key
The -i option allows you to specify the name of a private key file in *.PPK format which PuTTY will use to authenticate with the server. This option is only meaningful if you are using SSH.
For general information on public-key authentication, see
chapter 8
.
This option is equivalent to the ‘Private key file for authentication’ box in the Auth panel of the PuTTY configuration box (see
section
4.21.8
).
3.8.3.19 -loghost: specify a logical host name