Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Specify ngrok authtoken as param #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vochicong
Copy link

No description provided.

@demotomohiro
Copy link
Owner

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.

@vochicong
Copy link
Author

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

@demotomohiro
Copy link
Owner

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
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants