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

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

## 安装

```sh
sudo av install brew:autossh
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install autossh
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install autossh
```

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

### Linux

- apk (92%):

```sh
sudo apk add autossh
```

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

- Debian apt (92%):

```sh
sudo apt install autossh
```

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

- dnf (92%):

```sh
sudo dnf install autossh
```

  证据: Fedora Rawhide package metadata: autossh 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#autossh
```

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

- pacman (92%):

```sh
sudo pacman -S autossh
```

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

- zypper (92%):

```sh
sudo zypper install autossh
```

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

### Windows

- Scoop (92%):

```sh
scoop install main/autossh
```

  证据: Scoop official bucket manifest trees: bucket/autossh.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:autossh
- **软件包管理器:** Homebrew
- **版本:** 1.4g
- **来源摘要:** Automatically restart SSH sessions and tunnels
- **主页:** <https://www.harding.motd.ca/autossh/>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- autossh (别名)
- rscreen (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

autossh is a small C utility that starts ssh, monitors the connection, and restarts it when the session dies or stops passing traffic. It became a standard package-manager tool for keeping SSH tunnels alive without writing a custom supervisor loop.

### 项目历史

The official README traces autossh's idea to rstunnel, Reliable SSH Tunnel. Early autossh releases changed the monitoring mechanism from the original rstunnel-style idea to a loop of SSH forwardings and later added support for a remote echo service.

The CHANGES file records version 1.1 as the initial release, then shows the program growing through practical tunnel-management fixes: startup gate handling, monitor-port behavior, signal handling, backgrounding, pid files, autoconf support, and compatibility with OpenSSH option changes.

### 采用历史

autossh spread through Unix package systems because it solves an operationally boring but persistent problem: keeping reverse tunnels, long-lived forwards, and remote sessions running. The official page notes availability in OpenBSD and FreeBSD ports, Cygwin, and some Linux distributions; the input records packages across Homebrew, Debian, Ubuntu, Fedora, Alpine, Arch, MacPorts, Nix, Scoop, and zypper ecosystems.

### 使用方式

The normal invocation is `autossh -M port[:echo_port] [ssh options]`. autossh owns only a few flags, notably the monitor port, foreground/background behavior, and version output; most arguments are passed through to ssh.

For modern OpenSSH, the README documents `-M 0` to disable monitor ports and rely on SSH exit behavior, often paired with `ServerAliveInterval`, `ServerAliveCountMax`, and `ExitOnForwardFailure`. This is why autossh is common in init scripts, launch agents, simple service units, and admin one-liners.

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

autossh is the sort of tiny package that persists because it does exactly one sysadmin job and has almost no policy surface. Package maintainers care about it because it sits at the intersection of OpenSSH option churn, daemon supervision, legacy Unix platforms, and service startup semantics.

### 时间线

- Version 1.1: Initial release recorded in upstream CHANGES.
- Version 1.2: Major restructuring added looped forwarded ports for connection tests and backoff after rapid failures.
- Version 1.3: Remote echo-service monitoring and SIGUSR1 restart behavior added.
- Version 1.4: Basic GNU autoconf support and pid-file support added.
- 2019: Version 1.4g update noted on the official homepage.

### Related projects

- OpenSSH: autossh supervises the ssh client and passes through most options.
- rstunnel: upstream credits it as the original idea.
- screen: upstream mentions use with screen for persistent sessions.

### 来源

- <https://www.harding.motd.ca/autossh>
- <https://www.harding.motd.ca/autossh/CHANGES.txt>
- <https://www.harding.motd.ca/autossh/README.txt>
- source_facts.package-manager


## 安全说明

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

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

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

- Debian apt - autossh - 1.4g-1+b1: normalized package name match | Debian stable package indexes: autossh from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Automatically restart SSH sessions and tunnels | https://www.harding.motd.ca/autossh/
- Nix - autossh: normalized package name match | nixpkgs package indexes: pkgs/by-name/au/autossh/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - autossh - 1.4g-1: normalized package name match | Ubuntu 24.04 LTS package indexes: autossh from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Automatically restart SSH sessions and tunnels | https://www.harding.motd.ca/autossh/
- apk - autossh - 1.4g-r3: normalized package name match | Alpine Linux edge package indexes: autossh from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Automatically restart SSH sessions and tunnels | https://www.harding.motd.ca/autossh/
- apk - autossh-doc - 1.4g-r3: normalized package name match | Alpine Linux edge package indexes: autossh-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Automatically restart SSH sessions and tunnels (documentation) | https://www.harding.motd.ca/autossh/
- dnf - autossh - 1.4g-22.fc45: normalized package name match | Fedora Rawhide package metadata: autossh from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Utility to autorestart SSH tunnels | https://www.harding.motd.ca/autossh/
- pacman - autossh - 1.4g-4: normalized package name match | Arch Linux sync databases: autossh from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Automatically restart SSH sessions and tunnels | https://www.harding.motd.ca/autossh/
- zypper - autossh - 1.4g-2.25: normalized package name match | openSUSE Tumbleweed package metadata: autossh from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Automatically restart SSH sessions and tunnels | https://www.harding.motd.ca/autossh/
- MacPorts - autossh: normalized package name match | MacPorts ports tree: net/autossh/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/autossh: normalized package name match | Scoop official bucket manifest trees: bucket/autossh.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/autossh.yml](https://github.com/mxcl/pkgdb/blob/main/combined/autossh.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
