VSCODE : SSH远程配置+免密登录

SSH基础配置


填入地址,回车

bash 复制代码
ssh user@host-or-ip 

然后选择默认的配置,回车,得到以下结果:

  • 点击链接

  • 选择远程的系统

  • 输入密码

免密登录

  1. 生成SSH密钥:
    首先,确保你已经在本地生成了SSH密钥。你可以使用以下命令生成SSH密钥:
csharp 复制代码
(base) ubuntu@ubuntu-3090x2:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ubuntu/.ssh/id_rsa): 
/home/ubuntu/.ssh/id_rsa already exists.
Overwrite (y/n)? n
csharp 复制代码
(base) ubuntu@ubuntu-3090x2:~$ cd /home/ubuntu/.ssh
(base) ubuntu@ubuntu-3090x2:~/.ssh$ ls
authorized_keys  id_rsa  id_rsa.pub  known_hosts
  1. 创建authorized_keys文件:
csharp 复制代码
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
  1. 将SSH私钥下载到本地并添加到VSCODEconfig:
csharp 复制代码
Host ************
  HostName ************
  User ubuntu
  IdentityFile "C:\Users\using\Documents\remote\id_rsa"

经过以上操作即可免密登录了。

相关推荐
Julien20041 天前
Docker 网络(一)
linux·运维·服务器·ssh·学习方法
oooost1 天前
Jupyter Notebook 常用快捷键速查
ide·python·jupyter
ggaofeng1 天前
精简版ssh(去掉认证和加密流程,更清晰的展示远程登录的底层实现)
运维·ssh
承渊政道2 天前
Linux系统学习【线程概念与控制核心知识详解】
linux·运维·vscode·学习·ubuntu·线程创建 终止 等待
yqj2342 天前
ESP32-S3中小智项目优化内容
ide·macos·xcode
阿斌.com2 天前
Visual Studio 2026安装全攻略
ide·visual studio
YumiProxy2 天前
服务器动态IP导致SSH频繁断连?从保活配置到自动重连的完整排查方案
服务器·tcp/ip·ssh
我要神龙摆尾2 天前
IDEA 阅读插件
java·ide·intellij-idea·idea-plugs·plugs
梦幻通灵2 天前
IDEA 实用快捷键【持续更新】
java·ide·intellij-idea
Julien20043 天前
CGroups 资源控制组
linux·运维·服务器·ssh·学习方法