remocolab
remocolab copied to clipboard
Specify ngrok authtoken as param
ngrok token must be kept secret.
If you can specify ngrok token to remocolab.setupSSHD()
or remocolab.setupVNC()
, you can save ngrok token to a notebook.
Then, you might forget that your notebook contains it and share the notebook.
I understand people hate copy & pasting ngrok token everytime they use remocolab, but I don't know how to skip it without risking a security.
Can we save the token in Google Drive?
with open('/drive/ngrok-ssh/ngrok_token.txt') as f:
remocolab.setupSSHD(
ngrok_token=f.readline().strip(),
ngrok_region="jp",
)
You might be able to skip copy and pasting ngrok token by using google drive, but mounting google drive to a notebook requires copy and pasting authorization code. I don't think google drive is a safe place to keep secrets as files and folders in google drive can be shared.
You can also ssh to google colab using Serveo. It doesn't require creating account and tokens. But when I tried serveo, network speed was slower and higher latency compared to ngrok.
Sample code: https://github.com/demotomohiro/Google-Colaboratory-SSH-samples/blob/master/src/ssh_serveo.ipynb