1.远程登入
1.1默认当前用户登入
ssh xxx.xx.xxx.xx
1.2指定用户登入
[260254@w26-260254 ~]$ ssh zhong@xxx.xx.xxx.xx # ssh -l zhong xxx.xx.xxx.xx
zhong@xxx.xx.xxx.xx's password:
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.15.0-34-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
324 packages can be updated.
254 updates are security updates.
New release '18.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
1.3指定端口登入(默认22)
ssh xxx.xx.xxx.xx -p 4321 # 修改端口号:/etc/ssh/ssh_config
2.远程操作
zhong@slave2:~$ cat /etc/passwd # 查看所有用户名
参考文章
3.远程使用jupyter notebook
进入远程服务器:
zhong@slave2:~$ jupyter notebook --no-browser --port=8889
[W 11:07:04.990 NotebookApp] Unrecognized JSON config file version, assuming version 1
[I 11:07:06.419 NotebookApp] [nb_conda_kernels] enabled, 2 kernels found
[I 11:07:06.457 NotebookApp] Writing notebook server cookie secret to /run/user/1005/jupyter/notebook_cookie_secret
[I 11:07:06.664 NotebookApp] [nb_conda] enabled
[I 11:07:06.946 NotebookApp] [nb_anacondacloud] enabled
[I 11:07:07.131 NotebookApp] ✓ nbpresent HTML export ENABLED
[W 11:07:07.131 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named 'nbbrowserpdf'
[I 11:07:07.133 NotebookApp] Serving notebooks from local directory: /home/zhong
[I 11:07:07.133 NotebookApp] 0 active kernels
[I 11:07:07.133 NotebookApp] The Jupyter Notebook is running at: http://localhost:8889/
[I 11:07:07.133 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
进入本地terminal:
[260254@w26-260254 ~]$ ssh -N -f -L localhost:8888:localhost:8889 zhong@xxx.xx.xxx.xx
zhong@xxx.xx.xxx.xx's password:
进入本地浏览器:
localhost:8888
4.挂载远程文件系统
[260254@w26-260254 ~]$ sudo yum install sshfs
[260254@w26-260254 ~]$ sshfs -o idmap=user zhong@xxx.xx.xxx.xx:/home/zhong/pycharmProj /run/media/260254/dde9f86c-29a3-45bf-850a-5d24236399e0/zhong