Configure Ngrok

Creating the ngrok.yml

By default the file ngrok.yml is localed ~/.ngrok/ngrok.yml In case if you have paid ngrok account you can configure your yml just go to the https://dashboard.ngrok.com/reserved and add domains/tcp that you want to use

authtoken: ngrok_auth_token
region: us
tunnels:
  jenkins:
    addr: 8080
    proto: http
    subdomain: jenkins
  vnc:
    addr: 5900
    proto: tcp
    remote_addr: 1.tcp.ngrok.io:23797
  ssh:     
    addr: 5901     
	proto: tcp   
	my-ssh:     
	proto: tcp     
	addr: 22     
	remote_addr: 1.tcp.ngrok.io:22754

command to start ngrok is 

./ngrok start --all 

 

Setup autostart

Create the file com.ngrok.onstartup.plist and put it to /Library/LaunchDaemons

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
    <dict>     
        <key>Label</key>     
        <string>com.ngrok.onstartup</string>     
        <key>Program</key>     
        <string>/Users/MYUSER/ngrok.sh</string>     
        <key>KeepAlive</key>     <true/> 
    </dict> 
</plist>

ngrok.sh script

 #!/bin/sh while : ; do /usr/local/bin/ngrok start --all sleep 10 

Connecting via SSH

ssh user@1.tcp.ngrok.io -p22754

Connect via VNC

open vnc://1.tcp.ngrok.io:23797