Step-1: 在遠程服務器上,啓動jupyter notebooks服務:
jupyter notebook --no-browser --port=8889
Step-2: 在本地機器的Terminal中啓動SSH:
ssh -N -f -L localhost:8888:localhost:8889 remote_user@remote_host
其中: -N 告訴SSH沒有命令要被遠程執行; -f 告訴SSH在後臺執行; -L 是指定port forwarding的配置,遠端端口是8889,本地的端口號的8888。remote_user@remote_host 用實際的遠程帳戶和遠程地址替換
Step-3: 打開瀏覽器,輸入地址:http://localhost:8888/