Linux服务器远程连接并且配置pycharm、vscode(包括其中的jupyter notebook)

  • Linux新增用户tt

sudo adduser tt

adduser在创建用户时会主动调用 /etc/adduser.conf;

在创建用户主目录时默认在/home下,而且创建为 /home/用户名

  • 删除用户tt

连同用户拥有的所有文件删除:sudo deluser --remove-all-files tt

  • 查看本地用户

getent passwd | grep '/home' | cut -d: -f1,6

  • 查看显卡使用情况

nvidia-smi

  • 一张显卡被多个人使用

nvidia-smi -i 0 -c DEFAULT

  • Miniconda3的下载和安装

  1. 下载miniconda3

wget -c https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

  1. 运行sh文件

bash Miniconda3-latest-Linux-x86_64.sh

注:一直回车,输入yes,然后继续回车,输入yes。

  1. 重新打开shell文件
  2. 安装成功,conda的基本命令如下:

#显示conda的版本号

conda --version

#查看环境

conda info --envs

#或

conda env list

#配置bioconda,添加清华源镜像

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda

conda config --set show_channel_urls yes

#查看镜像源

conda config --show-sources

#安装软件到指定文件夹

conda install --prefix=<path> <package name>

  • pycharm远程连接的配置:

工具-->部署-->配置

部署路径就是你上传代码的地方

  • pycharm中的jupyter notebook远程连接的配置:

首先是在服务器上安装jupyter notebook

如何远程连接linux服务器上的jupyter notebook - 知乎 (zhihu.com)

然后就是pycharm中设置:

文件-->设置-->语言和框架-->Jupyter-->Jupyter服务器

问题:jupyter notebook需要每次都重新连接ssh然后在服务器上打开,才能进行远程连接正常运行,解决方法如下——

在终端输入:nohup jupyter notebook --allow-root &

但是,师兄说:

  • vscode远程连接

vscode连接远程服务器(傻瓜式教学)-CSDN博客

猜你喜欢

转载自blog.csdn.net/qq_46012097/article/details/134954275