centerOS 7.3
远程连接到 Linux 操作系统实例
# 生成 SSH Key
- 生成 SSH Key
$ ssh-keygen -t rsa -C "your_email@example.com"
- 配置
- 在 github /gitlab 中配置
~/.ssh/id_rsa.pub
中的内容 - 在目标服务器的
~/.ssh/authorized_keys
添加~/.ssh/id_rsa.pub
中的内容
# 安装 node
Note: Nodejs 版本各版本镜像 https://npm.taobao.org/mirrors/node
#### 切换目录 | |
$ cd /usr/local/src | |
#### 下载 - 此处下载的是编译好的 linux 版本的 node, 如果下载不带平台后缀的需要自行编译 | |
$ wget https://npm.taobao.org/mirrors/node/v12.14.1/node-v12.14.1-linux-x64.tar.gz | |
#### 解压 - 解压后可正常使用 | |
$ tar xvf node-v12.14.1-linux-x64.tar.gz | |
#### 添加到命令行 - 需要 root 权限 软连接 | |
$ ln -s /usr/local/src/node-v12.14.1-linux-x64/bin/node /usr/bin/node | |
$ ln -s /usr/local/src/node-v12.14.1-linux-x64/bin/npm /usr/bin/npm |
# 添加环境变量
$ vi ~/.bash_profile | |
### | |
export PATH=/usr/local/src/node-v12.14.1-linux-x64/bin/:$PATH | |
### | |
$ source ~/.bash_profile |
# 安装 pm2
$ npm install pm2 -g | |
$ ln -s /usr/local/src/node-v12.14.1-linux-x64/bin/pm2 /usr/bin/pm2 |
# 安装 Python3
参考
$ cd /usr/local/src | |
## 下载 | |
$ wget https://npm.taobao.org/mirrors/python/3.6.5/Python-3.6.5.tgz | |
## 解压 | |
$ tar -xzvf Python-3.6.5.tgz | |
## 初始化及其安装路径 | |
$ cd Python-3.6.5 | |
$ ./configure --prefix=/usr/local/src/python3 | |
## 编译 | |
$ make | |
## 编译安装 | |
$ make install | |
## 添加到命令行 | |
$ ln -s /usr/local/src/python3/bin/python3 /usr/bin/python3 |
# 安装 git
报错解决参考
## 下载解压 | |
$ wget https://github.com/git/git/archive/v2.17.0.tar.gz | |
$ tar -xzvf v2.17.0.tar.gz | |
$ cd ./git-2.17.0 | |
## 编译安装 - 此过程出现问题可以参考上面报错解决参考 | |
$ make prefix=/usr/local/src/git all | |
$ make install prefix=/usr/local/src/git | |
## 添加到命令行 | |
ln -s /usr/local/src/git/bin/git /usr/bin/git |
bash: git-upload-pack: command not foundgit clone git@xx.xx.xx.xx:/home/git/test.git --upload-pack "/usr/local/src/git/bin/git-upload-pack"