Win10怎么配置ssh密钥免密连接Linux服务器
时间:2023-05-21 11:08:44
Win10怎么配置ssh密钥免密连接Linux服务器?下文小编就为大家带来详细的配置图文教程,感兴趣的朋友一起看看吧
大多用户都都会使用SSH来连接linux服务器,在Win10系统下,我们都会使用OpenSSH来连接,如下图所示:
像这样:终端输入ssh
这样就是有的(好像Win10默认就是有的)。
然后生成密钥对:
ssh-keygen -t rsa
接着按提示信息可根据个人需求选择,这里是默认(连续三个回车即可)。
生成的密钥对默认保存在当前用户的根目录下的.ssh目录中(C:\Users\username\.ssh):
接着我们将公钥id_rsa.pub上传至Linux服务器(保存到你要连接的用户根目录下~/.ssh/中,没有.ssh目录则创建):
至于上传方法可使用各种途径,我使用的是lrzsz工具(可通过yum安装),通过Xshell可直接拖拽进行上传。
上传好后,将Linux中的id_rsa.pub重命名为authorized_keys,更改文件权限为600,更改.ssh目录权限为700:
mv id_rsa.pub authorized_keyschmod 600 authorized_keyschmod 700 .ssh
可以了。
现在通过Xshell连接Linux服务器:
如上图,选择Public Key,用户密钥浏览文件,选择刚才生成的密钥另外一个id_rsa,如果刚刚生成密钥是是默认操作,没设置密码,密码项就为空。确定即可连接成功。
在这里我使用的Xshell验证配置是否成功,但配置成功后用途绝不仅限于此,例如还可用于VSCode的Remote SSH连接服务器进行远程开发使用。
标签:Win10,ssh,密钥,Linux,服务器
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Win10系统KB4524244安装卡住怎么办 更新报错无法重置的解决方法
2023-05-18 04:30:54
![](https://img.aspxhome.com/file/2023/28/a240988_0s.jpg)
Excel2016怎么插入带勾的方框
2022-11-14 10:56:36
PQIMountSvc.exe是什么进程 PQIMountSvc进程查询
2022-07-02 12:50:22
word中怎么把一张页面设置成横向
2023-02-03 04:41:13
PS新手教程-如何使用PS把图片上的数字p成别的数字
2022-11-19 14:01:50
![](https://img.aspxhome.com/file/2023/6/a202166_0s.jpeg)
锂电池狂涨20%!下半年要买笔记本的受重伤
2023-05-03 05:02:38
![](https://img.aspxhome.com/file/2023/3/a300428_0s.jpg)
Windows 10 RS5新特性前瞻:好用到哭
2023-02-24 11:20:39
![](https://img.aspxhome.com/file/2023/4/a304200_0s.jpg)
怎么在excel2010中要录入身份证号
2022-05-16 15:06:25
![](https://img.aspxhome.com/file/2023/3/a140743_0s.png)
影视大全出现无法观看怎么办?影视大全出现无法观看的解决方法
2022-06-09 22:22:15
![](https://img.aspxhome.com/file/2023/8/a334835_0s.jpg)
Win10系统重置卡住了怎么办 Win10系统重置卡住了解决方法
2023-06-05 02:04:15
![](https://img.aspxhome.com/file/2023/25/a218695_0s.png)
如何在Mac上访问 USB 驱动器
2022-05-16 02:51:00
![](https://img.aspxhome.com/file/2023/6/a203306_0s.jpeg)
电脑Epic如何领取免费游戏
2023-04-30 05:12:18
![](https://img.aspxhome.com/file/2023/9/a341732_0s.jpg)
网站中打开了好多网页,一个一个的关闭都很费劲,怎么办?
2022-07-04 16:59:08
![](https://img.aspxhome.com/file/2023/9/a343517_0s.jpg)
Mac操作指南:Mac电脑屏幕变黄如何解决?
2023-05-04 06:38:29
![](https://img.aspxhome.com/file/2023/6/a203996_0s.jpeg)
如何处理PPT中大量文字的排版使得更简单明了
2023-11-28 02:49:15
![](https://img.aspxhome.com/file/2023/10/a353045_0s.jpg)
Excel2013表格怎么做图表? excel自定义设置图表的教程
2022-02-17 01:01:36
![](https://img.aspxhome.com/file/2023/3/40373_0s.png)
传闻苹果定制的“M2”处理器本月开始批量生产
2022-09-04 04:11:24
![](https://img.aspxhome.com/file/2023/3/a207173_0s.jpeg)
Win11如何开启夜间模式?Win11开启夜间模式操作方法
2023-09-23 00:04:53
![](https://img.aspxhome.com/file/2023/1/a283893_0s.png)
Win11 22H2闪屏怎么办?Win11 22H2电脑闪屏解决方法
2022-01-30 21:03:05
![](https://img.aspxhome.com/file/2023/27/a238861_0s.png)
WinXP怎么开启远程桌面 系统开启远程控制功能的方法
2023-06-27 04:48:02
![](https://img.aspxhome.com/file/2023/3/a297597_0s.jpg)