这里主要是通过ssh端口转发的方式实现。
nohup jupyter-notebook --notebook-dir <notebook data dir> --no-browser --port <jupyter port> --ip <server ip> > jupyter.log 2>&1 &
nohup ssh -i <private key> -N -f -L localhost:8888:<server ip>:<port> [username]@[ip address] >/dev/null 2>&1 &
在本地就可以通过http://localhost:port方式访问对应jupyter和tensorboard的服务,jupyter启动时所需要的token从日志文件里可以查找到。