-1

I follow this page to SELF HOSTED ngrok on my server (ngrok 1.7)
https://www.svenbit.com/2014/09/run-ngrok-on-your-own-server/

ATM, I can use the http protocol normally.
However, I want to use the ssh (tcp protocol) as well.
When try with below command

./ngrok -config=ngrok.cfg -proto tcp 22

ngrok
(Ctrl+C to quit)

Tunnel Status online
Version 1.7/1.7
Forwarding tcp://tunnel.mydomain.com:38005 -> 127.0.0.1:22
Web Interface 127.0.0.1:4040

# Conn 0

Avg Conn Time 0.00ms


The url format is quite differrent from provided ngrok (v2.x).

Forwarding tcp://0.tcp.ngrok.io:36428 -> localhost:22

I think that the ssh is exposed correctly but have no idea how to connect. Can you please show me the exact command to connect?

I try with below command but cannot success

ssh myuser@tunnel.mydomain.com -p 38005

ssh: connect to host tunnel.mydomain.com port 38005: Connection timed out

Quang Nguyen
  • 134
  • 1
  • 6

2 Answers2

0

It's due to the firewall issue. I have to open the port 38005 on ngrok server and ssh words flawlessly (with above command).

However, it's not a good idea that we have to open the port that base on the previous ngrok commmand. Do you guys know whether we can fix the port for tcp request?

Quang Nguyen
  • 134
  • 1
  • 6
0

found this SE and the solution linked below in August 2022. https://www.endtoend.ai/tutorial/ngrok-ssh-forwarding/ (published in Sept 2020) it uses snap for an easier ngrok install

https://snapcraft.io/install/ngrok/ubuntu

there's also this duplicate SE question. I like the ngrok.service solution.

How to keep ngrok running even when signing off of a server

worth noting you can use the ngrok.com dashboard to see your servers public ip.

https://dashboard.ngrok.com/tunnels/agents

CodingMatters
  • 1,275
  • 16
  • 26