LoginSignup
0
2

More than 5 years have passed since last update.

サーバで起動したJupyter Labをローカルで使用する

Last updated at Posted at 2018-12-24

SSHのポートフォワーディング

簡単に言うと、サーバ側で開いている(使用している)ポートをローカルで開いているものとして扱うことができる技

ローカル側

  • sshで接続
    • -Lオプションを使用
$ ssh -i 鍵 ユーザ名@IPアドレス -L 8889:localhost:8890
  • このコマンドでローカルの8889番ポートがサーバ側の8890番ポートに扮する。

サーバ側

  • 下記コマンドでJupyter Labを8890コマンドで起動
$ jupyter lab --port 8890

ローカル側

  • ブラウザで localhost:8889 で起動
    • サーバ側のJupyter Labが表示

以上

  • -Lオプションのどっちがローカル側でどっちがサーバ側か考えるのがめんどくさかったら下記コマンドでオッケー
ローカル側 ↓
$ ssh -i 鍵 ユーザ名@IPアドレス -L 8889:localhost:8889
サーバ側 ↓
$ jupyter lab --port 8889
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2