Skip to content

Instantly share code, notes, and snippets.

@CarsonSlovoka
Last active January 13, 2025 03:54
Show Gist options
  • Save CarsonSlovoka/7f84f2c70931d4bbc26859ef4f86f6de to your computer and use it in GitHub Desktop.
Save CarsonSlovoka/7f84f2c70931d4bbc26859ef4f86f6de to your computer and use it in GitHub Desktop.
for answer SSH reverse tunneling with ngrok

If you don't have the ~/.ssh/config file, you can create one yourself and then fill it with the content you need.

You can refer to the video around 0:51

This file is just for simplification. In fact, you can also use:

ssh -i ~/.ssh/my_privK -R 443:localhost:80 [email protected] http

to replace it, which works as well.

However, if you have the ~/.ssh/config file, it can look like this:

Host MyTest
    HostName connect.ngrok-agent.com
    User v2
    IdentityFile ~/.ssh/

Then the command can be written as:

ssh -R 443:localhost:80 MyTest http

Here, MyTest will be matched with the entry in your ~/.ssh/config file where the Host name is MyTest. From there, it fetches the corresponding User and HostName (in this case, v2 and connect.ngrok-agent.com).

The -i option is omitted in this case, as it refers to the IdentityFile.

Host MyTest
HostName connect.ngrok-agent.com
User v2
IdentityFile ~/.ssh/my_privK
@webmclink
Copy link

Hello, I am the one who commented on your youtube video just now. thank you for providing a notes. the config file doesn't have file extensions right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment