remocolab icon indicating copy to clipboard operation
remocolab copied to clipboard

Specify ngrok authtoken as param

Open vochicong opened this issue 4 years ago • 5 comments

vochicong avatar Mar 26 '20 04:03 vochicong

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.

demotomohiro avatar Mar 27 '20 22:03 demotomohiro

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",
  )

vochicong avatar Mar 27 '20 23:03 vochicong

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.

demotomohiro avatar Mar 29 '20 09:03 demotomohiro

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

demotomohiro avatar Mar 29 '20 09:03 demotomohiro