# 使用 Homebrew, Nix, winget 安装 ssh-copy-id

查看 ssh-copy-id 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:ssh-copy-id
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install ssh-copy-id
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#ssh-copy-id
```

  证据: nixpkgs package indexes: ssh-copy-id from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

### Windows

- winget (92%):

```sh
winget install --id axeprpr.SSHCopyID -e
```

  证据: Windows Package Manager source index: axeprpr.SSHCopyID from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:ssh-copy-id
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/ssh-copy-id>
- **版本:** 10.4p1
- **来源摘要:** Add a public key to a remote machine's authorized_keys file
- **主页:** <https://www.openssh.com/>
- **仓库:** <https://github.com/openssh/openssh-portable>
- **上游文档:** <https://www.openssh.com/>
- **许可证:** SSH-OpenSSH
- **源码归档:** <https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-10.4p1.tar.gz>
- **最后更新:** 2026-07-06T18:10:51Z
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- ssh-copy-id (cli)
- ssh-copy-id (别名)

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 all

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 10.4p1
- 管理器更新时间: 2026-07-06
- 本地数据: OK
- 上游仓库: https://www.openssh.com/
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

ssh-copy-id is the small OpenSSH-adjacent shell utility that installs a user's public SSH key into a remote account's authorized_keys file.

### 项目历史

OpenSSH itself began in 1999 when OpenBSD developers forked the free SSH 1.2.12/OSSH lineage, cleaned up licensing and portability issues, and shipped OpenSSH 1.2.2 with OpenBSD 2.6 on December 1, 1999. The portable OpenSSH tree was split out almost immediately for Linux and other Unix systems.

The ssh-copy-id script in the OpenSSH portable repository carries Philip Hands copyright from 1999 onward and describes itself as a shell script to install public keys on a remote machine. Over time it gained contributions for options such as force mode, dry-run mode, SFTP mode, alternate target paths, SSH config files, and port handling.

### 采用历史

ssh-copy-id became common Unix CLI glue because it automates the manual public-key setup described by ssh documentation: place a public key in the remote user's authorized_keys file. Homebrew packages it separately from the main OpenSSH formula for macOS users, while the input facts also list Nix and winget package names.

### 使用方式

The usual workflow is to run ssh-copy-id [-i identity_file] [user@]host. The script selects public keys from ssh-agent or from ${HOME}/.ssh/id*.pub, checks which keys are not already accepted, and appends the selected public keys to the remote .ssh/authorized_keys path unless a different target path is requested.

### 为什么软件包爱好者会关心

ssh-copy-id is package-manager folklore: a tiny shell script that saves users from remembering the exact ssh, mkdir, chmod, and cat incantation for public-key login setup. It is also a reminder that small contrib utilities can become first-class packages when operating systems omit them or users want them independently.

### 时间线

- 1999: OpenSSH project began and OpenSSH 1.2.2 shipped with OpenBSD 2.6.
- 1999: ssh-copy-id copyright begins with Philip Hands in the portable script.
- 2014: openssh/openssh-portable mirror repository created on GitHub.
- 2026: Homebrew formula tracks OpenSSH portable 10.3p1 for ssh-copy-id.

### Related projects

- Related commands and files include ssh, ssh-keygen, ssh-agent, ssh-add, sshd, OpenSSH portable, ${HOME}/.ssh/id*.pub, and .ssh/authorized_keys.

### 来源

- <https://api.github.com/repos/openssh/openssh-portable>
- <https://formulae.brew.sh/api/formula/ssh-copy-id.json>
- <https://github.com/openssh/openssh-portable/blob/master/contrib/ssh-copy-id>
- <https://www.openssh.com/history.html>
- input.source_facts.package-manager


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Credential files

- Unix: ${HOME}/.ssh/id*.pub, ${HOME}/.ssh/id*, .ssh/authorized_keys
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** ssh-copy-id
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** yes
- **URL Keys:** head, stable

## 其他软件包管理器记录

- Nix - ssh-copy-id: normalized package name match | nixpkgs package indexes: ssh-copy-id from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- winget - axeprpr.SSHCopyID: normalized package name match | Windows Package Manager source index: axeprpr.SSHCopyID from https://cdn.winget.microsoft.com/cache/source.msix


## 相关链接

- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Security and crypto packages](https://pkg.so/zh-hans/security-crypto-tools/) - Matched security, identity, cryptography, password, signing, or certificate metadata.
- [openssh](https://pkg.so/zh-hans/brew/openssh/) - Shares the same upstream homepage.
- [ssh-audit](https://pkg.so/zh-hans/brew/ssh-audit/) - Shares pkgdb curated category or tags: cli, security, ssh.
- [skm](https://pkg.so/zh-hans/brew/skm/) - Shares pkgdb curated category or tags: cli, security, ssh.
- [monkeysphere](https://pkg.so/zh-hans/brew/monkeysphere/) - Shares pkgdb curated category or tags: cli, openssh, security, ssh.
- [teleport](https://pkg.so/zh-hans/brew/teleport/) - Shares pkgdb curated category or tags: cli, security, ssh.
- [opkssh](https://pkg.so/zh-hans/brew/opkssh/) - Shares pkgdb curated category or tags: cli, security, ssh.
- [ssh-vault](https://pkg.so/zh-hans/brew/ssh-vault/) - Shares pkgdb curated category or tags: cli, security, ssh.
- [tsshd](https://pkg.so/zh-hans/brew/tsshd/) - Shares pkgdb curated category or tags: cli, security, ssh.

## Combined YAML source

View the package source record on GitHub. [combined/ssh-copy-id.yml](https://github.com/mxcl/pkgdb/blob/main/combined/ssh-copy-id.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
