VsCode SSH远程设置不用重复输入密码

  1. win+R输入cmd,回车,输入

    C:\Users\Administrator> ssh-keygen -t rsa -b 4096
    Generating public/private rsa key pair.
    Enter file in which to save the key (C:\Users\Administrator/.ssh/id_rsa):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in C:\Users\Administrator/.ssh/id_rsa
    Your public key has been saved in C:\Users\Administrator/.ssh/id_rsa.pub
    The key fingerprint is:
    SHA256:2Eb9hOSjGuN+DFd326LpONB0UQtRCvZtrAi1i0UfkM0 administrator@HanYouyang
    The key's randomart image is:
    +---[RSA 4096]----+
    | B=++o |
    | B.E . |
    | o B =.= |
    | + =o*oo. |
    | + S+ooo. o |
    | ..=o . o .|
    | o+ . o . |
    | . o ..o |
    | .. .o. |
    +----[SHA256]-----+

2.到生成的文件目录下

复制代码
C:\Users\Administrator>cd  C:\Users\Administrator\.ssh

3,在远程linux服务器上新建文件夹,在文件下新建.ssh文件夹

我在root文件夹下新建了.ssh文件夹

复制代码
[root@localhost ~]#mkdir .ssh

4.在cmd命令行输入,linux服务器.ssh文件夹下增加id_rsa.pub文件

复制代码
C:\Users\Administrator\.ssh>scp id_rsa.pub root@192.168.145.101:.ssh/
root@192.168.145.101's password:
id_rsa.pub

5.linux服务器输入

复制代码
[root@localhost .ssh]#cat id_rsa.pub >> authorized_keys

6.vscode重新连接,不需要输入密码


推荐一个零声学院项目课,个人觉得老师讲得不错,分享给大家:
零声白金学习卡(含基础架构/高性能存储/golang云原生/音视频/Linux内核)
https://xxetb.xet.tech/s/3Zqhgt

相关推荐
caz282 小时前
git bash突然ssh不能用了
git·ssh·bash
散峰而望3 小时前
OJ 题目的做题模式和相关报错情况
java·c语言·数据结构·c++·vscode·算法·visual studio code
Remember_9933 小时前
【JavaSE】一站式掌握Java面向对象编程:从类与对象到继承、多态、抽象与接口
java·开发语言·数据结构·ide·git·leetcode·eclipse
我发在否4 小时前
OpenResty > Lua断点调试
vscode·lua·断点·openresty·luapanda
littlegirll17 小时前
ssh远程调用图形程序
运维·ssh·x11forwarding·远程调用图形界面
ltqshs18 小时前
vscode离线插件下载-vscode编译嵌入式C语言配置
c语言·ide·vscode
acanab19 小时前
UE使用VScode开发 配置过程
ide·vscode·编辑器
小尤笔记20 小时前
【2024版】超详细Python+Pycharm安装保姆级教程,Python环境配置和使用指南,看完这一篇就够了
开发语言·ide·python·pycharm·编程语言·解释器
江拥羡橙20 小时前
vscode使用windsurf获取token
vscode·ai·windsurf
weixin_516023071 天前
ssh配合密钥连接
服务器·网络·ssh