# Install autossh with Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, scoop, zypper

Automatically restart SSH sessions and tunnels. Version 1.4g via Homebrew; verified from local package data.

## Install

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

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install autossh
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install autossh
```

  Evidence: 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
```

  Evidence: 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
```

  Evidence: 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
```

  Evidence: Fedora Rawhide package metadata: autossh from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#autossh
```

  Evidence: 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
```

  Evidence: 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
```

  Evidence: openSUSE Tumbleweed package metadata: autossh from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

### Windows

- Scoop (92%):

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

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

## Package facts

- **Package key:** brew:autossh
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/autossh>
- **Version:** 1.4g
- **Source summary:** Automatically restart SSH sessions and tunnels
- **Homepage:** <https://www.harding.motd.ca/autossh/>
- **Upstream docs:** <https://www.harding.motd.ca/autossh>
- **License:** BSD-1-Clause
- **Source archive:** <https://www.harding.motd.ca/autossh/autossh-1.4g.tgz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- autossh (cli)
- rscreen (cli)
- autossh (alias)
- rscreen (alias)

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 1.4g
- Local data: ok
- Upstream repository: https://www.harding.motd.ca/autossh/
- info: No package-manager update timestamp was available.
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

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.

### Project history

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.

### Adoption history

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.

### How it is used

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.

### Why package nerds care

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.

### Timeline

- 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.

### Sources

- <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


## Security Notes

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

- **Geiger risk:** blue / medium
- broad file, network, media, or database tool signal

## Source Database Details

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

## Other Package-Manager Records

- 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-21.fc44: normalized package name match | Fedora Rawhide package metadata: autossh from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-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.23: normalized package name match | openSUSE Tumbleweed package metadata: autossh from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-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


## Related links

- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Homebrew utility packages](https://www.automicvault.com/pkg/brew-utility-packages/) - Matched Homebrew package provider.
- [boring](https://www.automicvault.com/pkg/brew/boring/) - Shares av.db curated category or tags: cli, networking, ssh, tunnel, tunneling.
- [rospo](https://www.automicvault.com/pkg/brew/rospo/) - Shares av.db curated category or tags: cli, networking, ssh, tunneling.
- [corkscrew](https://www.automicvault.com/pkg/brew/corkscrew/) - Shares av.db curated category or tags: cli, networking, ssh, tunneling.
- [dns2tcp](https://www.automicvault.com/pkg/brew/dns2tcp/) - Shares av.db curated category or tags: cli, networking, tunnel, tunneling.
- [proxytunnel](https://www.automicvault.com/pkg/brew/proxytunnel/) - Shares av.db curated category or tags: cli, networking, ssh, tunnel, tunneling.
- [udp2raw-multiplatform](https://www.automicvault.com/pkg/brew/udp2raw-multiplatform/) - Shares av.db curated category or tags: cli, networking, tunnel, tunneling.
- [bore-cli](https://www.automicvault.com/pkg/brew/bore-cli/) - Shares av.db curated category or tags: cli, networking, tunneling.
- [cloudflared](https://www.automicvault.com/pkg/brew/cloudflared/) - Shares av.db curated category or tags: cli, networking, tunnel, tunneling.

## Combined YAML source

View the package source record on GitHub. [combined/autossh.yml](https://github.com/automic-vault/db/blob/main/combined/autossh.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
