PowerShell 使用私钥登录 远程主机

从 Windows 10 开始,Windows 开始自带 OpenSSH 工具
Windows SSH 配置目录,%USERPROFILE%.ssh\

配置 OpenSSH 使用私钥登录 的配置
修改 %USERPROFILE%.ssh\config 文件
添加配置,格式如下

host p1
user root
hostname ip或者域名
identityfile C:\Users\用户名\.ssh\xxx.pem

使用 OpenSSH 登录,打开powershell,输入命令
ssh p1
私钥登录搞定!

参考链接

posted @ 2022-04-24 22:40  专职  阅读(491)  评论(0编辑  收藏  举报