Skip to content

VScode 远程开发配置 #13

@guanguans

Description

@guanguans

远程主机安装 ssh-server

# 根据本地 OS 选择安装方式
$ sudo apt install openssh-server

本地主机安装 ssh-client

根据本地 OS 选择安装方式,macOS 自带,winOS 安装了 git 客户端就有了。

安装 Remote Development 插件

配置 Remote Development

Host 自己腾讯云
    HostName your_IP
    User your_username
    Port 22
    IdentityFile "your_path/.ssh/id_rsa"

1

2

连接远程主机

3

4

5

选择 ssh 无密码远程登陆

  1. 首先在客户端生成 ssh 密钥(如果已经生成了的话忽略这步)
$ ssh-keygen
  1. 拷贝本地公钥到远程服务器
$ ssh-copy-id [email protected]
  1. 将公钥加入 authorized_keys 文件
$ cat ~/.ssh/your_id_rsa.pub  >> ~/.ssh/authorized_keys
  1. 以后登录就不用输密码了

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions