Install and run ttyd:
$ brew install ttyd
$ ttyd --writable bash
Secure the ttyd server with basic auth:
$ ttyd --writable --credential testuser:testpw bash
lws_socket_bind: source ads 127.0.0.1
Listening on port: 7681
...
Expose the ttyd port:
$ ngrok http 7681