Skip to content

Instantly share code, notes, and snippets.

@bqhuyy
Last active March 28, 2021 15:04
Show Gist options
  • Select an option

  • Save bqhuyy/c2ed908fa04f5eafad6b3c3d88fa0e4c to your computer and use it in GitHub Desktop.

Select an option

Save bqhuyy/c2ed908fa04f5eafad6b3c3d88fa0e4c to your computer and use it in GitHub Desktop.

Revisions

  1. bqhuyy revised this gist Mar 28, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions port-forwarding.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    # reverse port forwarding
    Dùng để map port máy local đến server
    Dùng để map port máy local đến server <br>
    `ssh [-f: background] [-N: forwarding only] -R <host_port>:localhost:<client_port> <host_domain>`

    # map port
    Dùng để map port server về local
    Dùng để map port server về local <br>
    `ssh [-f] [-N] -L 0.0.0.0:<client_port>:localhost:<host_port> user@<host_domance> -p <port>`

    # using public ip to host server
  2. bqhuyy revised this gist Mar 28, 2021. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion port-forwarding.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,10 @@
    # reverse port forwarding
    `ssh [-f: background] [-N: forwarding only] -R <host-port>:localhost:<client-port> <host_domain>`
    Dùng để map port máy local đến server
    `ssh [-f: background] [-N: forwarding only] -R <host_port>:localhost:<client_port> <host_domain>`

    # map port
    Dùng để map port server về local
    `ssh [-f] [-N] -L 0.0.0.0:<client_port>:localhost:<host_port> user@<host_domance> -p <port>`

    # using public ip to host server
    1. open port in router (for public ip) => map **local** port and **public** port
  3. bqhuyy created this gist Mar 28, 2021.
    8 changes: 8 additions & 0 deletions port-forwarding.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # reverse port forwarding
    `ssh [-f: background] [-N: forwarding only] -R <host-port>:localhost:<client-port> <host_domain>`

    # using public ip to host server
    1. open port in router (for public ip) => map **local** port and **public** port
    2. use openssh to host server
    - `sudo vim /etc/ssh/sshd_config` => setting port
    - `sudo service ssh start`