What is the equivalent of linux terminal command: "SSH -NCD <port> <user@vpsserver>" in Windows?

Denatunium 0 Reputation points
2023-03-12T14:19:33.9766667+00:00

I ask this question according to Microsoft MVP recommendation here .

I used this method(written in topic) in Linux terminal and it worked like a VPN for me but since I have changed my OS to Windows I cannot find equivalent for this

command... Any help will be appreciated

installed putty but it seems there is no such option there...


(in short, it listens to an Ip and port which later you forward your whole traffic to that ip/port (localy) using
socks proxy and then it sends and receives all traffic to and from VPS(Virtual Private Server) and it acts as a VPN... .
So I wonder if this command or ability is present in windows, should I install any built-in feature using 
"turn windows features on/off " in control panel? or ...?

 The description of the command with its options is as below:

 ssh — OpenSSH remote login client

   -N      Do not execute a remote command.  This is useful for just
             forwarding ports.  Refer to the description of SessionType
             in ssh_config(5) for details.

  -C      Requests compression of all data (including stdin, stdout,
             stderr, and data for forwarded X11, TCP and UNIX-domain
             connections).  The compression algorithm is the same used
             by gzip(1).  Compression is desirable on modem lines and
             other slow connections, but will only slow down things on
             fast networks.  The default value can be set on a host-by-
             host basis in the configuration files; see the Compression
             option in ssh_config(5).

-D [bind_address:]port
             Specifies a local “dynamic” application-level port
             forwarding.  This works by allocating a socket to listen to
             port on the local side, optionally bound to the specified
             bind_address.  Whenever a connection is made to this port,
             the connection is forwarded over the secure channel, and
             the application protocol is then used to determine where to
             connect to from the remote machine.  Currently the SOCKS4
             and SOCKS5 protocols are supported, and ssh will act as a
             SOCKS server.  Only root can forward privileged ports.
             Dynamic port forwardings can also be specified in the
             configuration file.

             IPv6 addresses can be specified by enclosing the address in
             square brackets.  Only the superuser can forward privileged
             ports.  By default, the local port is bound in accordance
             with the GatewayPorts setting.  However, an explicit
             bind_address may be used to bind the connection to a
             specific address.  The bind_address of “localhost”
             indicates that the listening port be bound for local use
             only, while an empty address or ‘*’ indicates that the port
             should be available from all interfaces.
-----------------------
Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MotoX80 36,401 Reputation points
    2023-03-12T15:25:53.8533333+00:00

    If those are Open SSH options, then in Settings, install the OpenSSH client feature.

    User's image

    That will install version 8.6.0.1.

    C:\>sigcheck64 -nobanner C:\Windows\System32\OpenSSH\ssh.exe
    c:\windows\system32\openssh\ssh.exe:
            Verified:       Signed
            Signing date:   12:04 AM 5/7/2022
            Publisher:      Microsoft Windows
            Company:        n/a
            Description:    n/a
            Product:        OpenSSH for Windows
            Prod version:   OpenSSH_8.6p1 for Windows
            File version:   8.6.0.1
            MachineType:    64-bit
    
    C:\>ssh
    usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
               [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
               [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
               [-i identity_file] [-J [user@]host[:port]] [-L address]
               [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
               [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
               [-w local_tun[:remote_tun]] destination [command]
    
    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.