Copy-SshId

2.1.1

向目标主机安装SSH公钥实现免密登录,或从目标主机移除本机公钥恢复密码登录。

语法:
 安装公钥:Copy-SshId [用户@]主机 [-RemoteUser 用户] [-RemotePort 端口] [-KeyFile 公钥路径]
   别名:-RemoteUser=-l  -RemotePort=-p  -KeyFile=-i
   例:Copy-SshId root@192.168.1.10
       Copy-SshId 192.168.1.10 -l root -p 2222 -i C:\Users\xxx\.ssh\id_ed25519.pub
   未指定 -KeyFile 时自动选用 ~\.ssh 下第一个可用公钥;免密已生效时直接跳过。

 移除公钥:Remove-SshId
向目标主机安装SSH公钥实现免密登录,或从目标主机移除本机公钥恢复密码登录。

语法:
 安装公钥:Copy-SshId [用户@]主机 [-RemoteUser 用户] [-RemotePort 端口] [-KeyFile 公钥路径]
   别名:-RemoteUser=-l  -RemotePort=-p  -KeyFile=-i
   例:Copy-SshId root@192.168.1.10
       Copy-SshId 192.168.1.10 -l root -p 2222 -i C:\Users\xxx\.ssh\id_ed25519.pub
   未指定 -KeyFile 时自动选用 ~\.ssh 下第一个可用公钥;免密已生效时直接跳过。

 移除公钥:Remove-SshId [用户@]主机 [-RemoteUser 用户] [-RemotePort 端口] [-KeyFile 公钥路径]
   例:Remove-SshId root@192.168.1.10
   仅在当前可免密登录时执行;未指定 -KeyFile 时移除 ~\.ssh 下所有公钥对应条目。
Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name Copy-SshId

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name Copy-SshId

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 埃博拉酱. All rights reserved.

Package Details

Author(s)

  • 埃博拉酱

Tags

SSH 公钥 免密登录 authorized_keys OpenSSH Windows Linux

Dependencies

This module has no dependencies.

Release Notes

修复Linux上的语法错误问题,绕开 Windows OpenSSH 客户端对 umac 系列 MAC 的计算缺陷

FileList

Version History

Version Downloads Last updated
2.1.1 (current version) 10 9/14/2026
2.1.0 37 8/4/2026
2.0.0 41 6/30/2026