VS Code 多跳板机连到目标服务器

一、需求

本机 在 vs code 通过多个跳板机连到目标服务器,进行开发

本机(vs code) --> 服务器 jumper 1 --> 服务器 jumper 2 --> 目标服务器 GPU

二、步骤

1、 将本机的公钥复制到所有服务器(跳板机服务器+目标服务器)

a. 在cmd输入

bash 复制代码
ssh-keygen -t rsa -b 4096

b 复制公钥(USERPROFILE.ssh\id_rsa.pub里的内容)到 所有 服务器 ~/.ssh/authorized_keys

2. 安装vs code

找其他教程安装,这略过

3. 安装 ssh插件

4. 配置ssh

点击 齿轮****

点击配置文件

填配置文件 (记得填ip)

bash 复制代码
Host Jump_1  
    HostName Jump_1的ip
    User xx
    IdentityFile ~/.ssh/id_rsa

Host Jump_2
    HostName Jump_2的ip
    User xx
    ProxyJump Jump_1
    IdentityFile ~/.ssh/id_rsa
    ServerAliveInterval 30
    ServerAliveCountMax 1000000

Host GPU_server
    HostName GPU_server的ip
    User xx
    ProxyJump Jump_2      
    IdentityFile ~/.ssh/id_rsa
    ServerAliveInterval 30
    ServerAliveCountMax 1000000

5. 点击使用

相关推荐
雪可问春风1 天前
docker环境部署
运维·docker·容器
lwx9148521 天前
Linux-Shell算术运算
linux·运维·服务器
翻斗包菜1 天前
PostgreSQL 日常维护完全指南:从基础操作到高级运维
运维·数据库·postgresql
somi71 天前
ARM-驱动-02-Linux 内核开发环境搭建与编译
linux·运维·arm开发
海的透彻1 天前
nginx启动进程对文件的权限掌控
运维·chrome·nginx
路溪非溪1 天前
Linux驱动开发中的常用接口总结(一)
linux·运维·驱动开发
此刻觐神1 天前
IMX6ULL开发板学习-01(Linux文件目录和目录相关命令)
linux·服务器·学习
航Hang*1 天前
第3章:Linux系统安全管理——第2节:部署代理服务
linux·运维·服务器·开发语言·笔记·系统安全
fengfuyao9851 天前
VC++基于服务器的点对点文件传输实例
服务器·开发语言·c++
favour_you___1 天前
epoll惊群问题与解决
服务器·网络·tcp/ip·epoll