• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

windows powershell 和linux 配置 openssh ssh-copy-id 互信

武飞扬头像
ghostwritten
帮助1

学新通

第一步

PS C:\Users\Christopher> ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\Christopher/.ssh/id_rsa):
Created directory 'C:\Users\Christopher/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\Christopher/.ssh/id_rsa.
Your public key has been saved in C:\Users\Christopher/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:/mjkrJOQbRzCAwlSPYVBNcuxntm/Ms5/MMC15dCRrMc christopher@Christopher-Win10-VM-01
The key's randomart image is:
 ---[RSA 2048]---- 
|oo. o==    o.o   |
|. o  . =  o =    |
|   o . . . B     |
|     .. o o E    |
|     * .S. .     |
|    o  ...o      |
|     o =. .o     |
|      o.*o ..    |
|      .=   .     |
 ----[SHA256]----- 
PS C:\Users\Christopher>
Copy SSH Key to Remote L
学新通

第二步

格式:

type $env:USERPROFILE\.ssh\id_rsa.pub | ssh root@192.168.30.31 "cat >> .ssh/authorized_keys"

示例

PS C:\Users\Christopher> type $env:USERPROFILE\.ssh\id_rsa.pub | ssh root@192.168.30.31 "cat >> .ssh/authorized_keys"
The authenticity of host '192.168.30.31 (192.168.30.31)' can't be established.
ECDSA key fingerprint is SHA256:mTD0/WNCVZ/p/PFSkNDmLJtzIGb5eD7qj6erOQkomjM.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.30.31' (ECDSA) to the list of known hosts.
christopher@192.168.30.31's password:
PS C:\Users\Christopher>

第三步

PS C:\Users\Christopher> ssh 192.168.30.31
Last login: Sat May 23 12:44:51 2020 from 192.168.10.139
[christopher@linux ~]$ who

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhihahfc
系列文章
更多 icon
同类精品
更多 icon
继续加载