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"

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

相关推荐
炸膛坦客4 小时前
Git 和 GitHub:(七)将本地新建仓库与 GitHub 远程仓库关联起来(SSH)
git·ssh·github
gongzhxu12 小时前
JetBrains IDEA开发环境搭建
java·ide·intellij-idea
独隅13 小时前
DevEco Code Plan+Build 双 Agent 协同开发实效解析
ide·华为
Yolanda_20221 天前
在vscode终端中可使用pip,但是cmd终端中找不到命令 pip问题的解决
vscode·python·conda·pip
ITmaster07311 天前
告别 IDE?Android CLI 来了,开发进入 AI Agent 时代
android·ide·人工智能
π同学1 天前
ESP-IDF+vscode开发ESP32 联网篇第一讲——WIFI扫描
vscode·esp32c6·wifi scan
小莫分享2 天前
sshw:用交互搜索和 Web 配置高效管理 SSH Server
linux·运维·golang·开源·ssh
jiang_changsheng2 天前
详细教程__--PyCharm Terminal--切conda环境详解
ide·pycharm·conda
Jerry小杰2 天前
运维神器|单端口搞定多台内网SSH!frp端口复用终极教程
运维·ssh
BD_Marathon2 天前
xshell无法连接上centos7
ssh