# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper 安装 keychain

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

## 安装

```sh
sudo av install brew:keychain
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install keychain
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install keychain
```

  证据: MacPorts ports tree: sysutils/keychain/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add keychain
```

  证据: Alpine Linux edge package indexes: keychain from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install keychain
```

  证据: Debian stable package indexes: keychain from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install keychain
```

  证据: Fedora Rawhide package metadata: keychain from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#keychain
```

  证据: nixpkgs package indexes: pkgs/by-name/ke/keychain/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S keychain
```

  证据: Arch Linux sync databases: keychain from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install keychain
```

  证据: openSUSE Tumbleweed package metadata: keychain from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:keychain
- **软件包管理器:** Homebrew
- **版本:** 3.0.2
- **来源摘要:** User-friendly front-end to ssh-agent(1)
- **主页:** <https://www.funtoo.org/Keychain>
- **仓库:** <https://github.com/danielrobbins/keychain>
- **最后更新:** 2026-07-31T00:19:10Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- keychain (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 3.0.2
## 项目历史与用法

Keychain is Daniel Robbins' long-running helper for sharing ssh-agent and gpg-agent state across login shells, remote sessions, cron jobs, and other long-lived user environments. It solves the everyday Unix annoyance of spawning or unlocking a new agent for every terminal.

### 项目历史

Keychain was created by Daniel Robbins and became associated with Gentoo and Funtoo-era shell workflows. The classic implementation was a shell script that wrote reusable environment snippets under the user's home directory so later shells could attach to the same agent.

The project moved back under Daniel Robbins' GitHub account as its official home after a period under Funtoo. In the 2.9 series the project deprecated older options such as --agents, and in the 3.0 beta series it began a ground-up Python 3 rewrite while preserving compatibility with traditional invocations.

### 采用历史

Keychain spread widely because it fit naturally into .bash_profile, .zprofile, cron, and remote-login setups. Package-manager coverage across Alpine, Debian, Fedora, Homebrew, MacPorts, Nix, Arch, Ubuntu, and openSUSE reflects how common ssh-agent reuse became for developers and administrators.

### 使用方式

A typical setup runs keychain during shell startup, evaluates its environment output, and then reuses the existing ssh-agent or gpg-agent rather than prompting for every new session. The 3.0 beta changelog focuses on multi-terminal coordination and more reliable GPG warm-up, which are exactly the rough edges users hit in modern terminal multiplexers, IDE terminals, and WSL sessions.

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

Keychain is a small package with outsized dotfile significance: it is glue between OpenSSH, GnuPG, login shells, and package-managed user environments. It also shows how a simple shell utility can remain useful for decades and later be rewritten without changing the user-facing contract too abruptly.

### 时间线

- 2000s: Keychain became a common Gentoo/Funtoo-associated ssh-agent helper created by Daniel Robbins.
- 2025: The Funtoo archive noted Daniel Robbins' return as maintainer and pointed to the danielrobbins/keychain GitHub repository as the official home.
- 2025: Keychain 2.9 deprecated --agents and related legacy behavior.
- 2026-06: Keychain 3.0.0_beta1 introduced a Python 3 rewrite.
- 2026: Keychain 3.0.0_beta2 added coordinated multi-terminal initialization and stronger GPG verification behavior.

### Related projects

- Keychain wraps OpenSSH's ssh-agent and ssh-add and can coordinate with gpg-agent. It is adjacent to shell startup frameworks, password managers that expose SSH agents, and OS-native keychain services, but its historical niche is portable Unix shell glue.

### 来源

- <https://github.com/danielrobbins/keychain>
- <https://github.com/danielrobbins/keychain/blob/master/ChangeLog.md>
- <https://man.freebsd.org/cgi/man.cgi?query=keychain&sektion=1>
- <https://manpages.ubuntu.com/manpages/focal/man1/keychain.1.html>
- <https://www.funtoo.org/Funtoo%3AKeychain>


## 安全说明

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

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

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

- Debian apt - keychain - 2.8.5-5: normalized package name match | Debian stable package indexes: keychain from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | key manager for OpenSSH | https://www.funtoo.org/Keychain
- Nix - keychain: normalized package name match | nixpkgs package indexes: pkgs/by-name/ke/keychain/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - keychain - 2.8.5-4: normalized package name match | Ubuntu 24.04 LTS package indexes: keychain from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | key manager for OpenSSH | https://www.funtoo.org/Keychain
- apk - keychain - 2.9.8-r0: normalized package name match | Alpine Linux edge package indexes: keychain from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | keychain ssh-agent front-end | https://github.com/danielrobbins/keychain
- apk - keychain-doc - 2.9.8-r0: normalized package name match | Alpine Linux edge package indexes: keychain-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | keychain ssh-agent front-end (documentation) | https://github.com/danielrobbins/keychain
- dnf - keychain - 3.0.2-1.fc45: normalized package name match | Fedora Rawhide package metadata: keychain from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Agent manager for OpenSSH, ssh.com, Sun SSH, and GnuPG | https://kernel-seeds.org/projects/keychain/
- pacman - keychain - 3.0.2-1: normalized package name match | Arch Linux sync databases: keychain from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A front-end to ssh-agent, allowing one long-running ssh-agent process per system, rather than per login | https://www.funtoo.org/Keychain
- zypper - keychain - 2.8.5-3.3: normalized package name match | openSUSE Tumbleweed package metadata: keychain from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A Key Management Application for SSH2 RSA/DSA and GnuPG Keys | https://www.funtoo.org/Keychain
- MacPorts - keychain: normalized package name match | MacPorts ports tree: sysutils/keychain/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
