Self-hosted service
jtesta/ssh-audit avatar
jtesta/ssh-audit

ssh-audit: auditing both ends of an SSH connection

SSH server & client security auditing (banner, key exchange, encryption, mac, compression, compatibility, security, etc)

4,350 stars244 forksPythonMIT

At a glance

What is it?
ssh-audit connects to a running SSH daemon or client, fingerprints the software, and prints key exchange, host key, encryption, and MAC algorithms with availability and hardening advice. It is the maintained v2.0+ fork of the inactive arthepsy project, runs on Python with no dependencies, and ships a policy mode for pass or fail checks.
Who is it for?
ssh-audit is a good fit if you need a quick, dependency free read on what your SSH endpoints actually negotiate. Do not treat an exit code of 0 as proof the host is safe, remember the algorithm history only covers OpenSSH, Dropbear, and libssh, and keep the DHEat mode pointed at hosts you are allowed to test.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 24, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • jtesta/ssh-audit4,350 ★ · +44
Star history
Repository2026-09-232026-11-24
jtesta/ssh-audit4.3k4.4k

44 Stars in the last 62 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

It audits the client as readily as the server

ssh-audit treats both ends of an SSH connection as audit targets, and the client side is a mode rather than a separate tool. Passing -c starts a listener that accepts an incoming handshake, listening on port 2222/tcp by default, which you then connect to with ssh -p 2222 anything@localhost. To move the listener you add -p, for instance -p 4567. For the server side you just point the tool at a target, either a hostname, an IPv4 or IPv6 literal with an optional port such as 127.0.0.1:222, or even a local unix socket through unix:///run/ssh-unix-local/socket. That dual nature is why the same binary tells you what your own client offers as well as what your daemon offers.

code
ssh-audit localhost
ssh-audit 127.0.0.1
ssh-audit 127.0.0.1:222
ssh-audit ::1
ssh-audit [::1]:222
ssh-audit unix:///run/ssh-unix-local/socket

To sweep many hosts at once you place them in servers.txt, one HOST[:PORT] per line, and pass that file with -T.

Banner grabbing and OS fingerprinting happen before the algorithm list

The first thing ssh-audit does after the banner exchange is work out what it is talking to. It grabs the banner, recognizes the device or software and the operating system behind it, and detects whether compression is in use. That reconnaissance is what lets the later output carry meaning: the recommendations it prints are derived from the recognized software version, so the same algorithm can be flagged to remove on one platform and still be the norm on another. It also checks SSH version compatibility based on the algorithms the peer offers. The net effect is that the output is not a raw dump of negotiated ciphers but an interpretation tied to the far end's identity.

Algorithm tables carry availability, removal, and append or remove advice

The core output gathers four algorithm families from the peer: key exchange, host key, encryption, and message authentication code algorithms. Each is annotated with security information such as when it became available, whether it has been removed or disabled, and whether it counts as unsafe, weak, or legacy. Alongside that sits an algorithm recommendation that tells you whether to append or remove an entry based on the recognized software version. This is the part that turns a handshake scan into a hardening task: you are not just told that a weak MAC is present, you are told whether to remove it based on the recognized software version. Historical data is drawn from OpenSSH, Dropbear SSH, and libssh to make those judgements concrete.

Algorithm history only covers OpenSSH, Dropbear, and libssh

Here is a limit worth stating plainly. The historical information the tool reasons with comes from OpenSSH, Dropbear SSH, and libssh. If your target runs SSH software outside those three families, the availability and removal dates that make a recommendation trustworthy thin out, and the advice becomes less specific even though the scan itself still completes. That matters for the compliance story: a green result against a lesser known implementation is not as well grounded as one against OpenSSH. Before you attach a policy verdict to a nonstandard appliance, confirm which software the banner fingerprint reported and treat an unrecognized product as an area that needs manual review rather than a clean bill of health.

Policy mode turns the scan into pass or fail against a named standard

Beyond the free form standard audit, ssh-audit ships policy scans to check adherence to a hardened or standard configuration. You list the built-in policy names with -L, then apply one to a server with -P, naming either a built-in policy or a path to your own policy file. A policy audit can target a server, a client with -c, or many servers by combining -T with -P. If you have no policy yet, -M generates one from a target server, producing a new_policy.txt you can then edit by hand. The README's examples use separate server and client policy files, so the file you pass should match whether you are auditing the daemon or the client.

An exit code of zero means algorithms are secure, not that the host is safe

The exit code contract is narrow and easy to overread. Zero is returned when all algorithms are considered secure in a standard audit, or when a policy check passes in a policy audit. It says nothing about the rest of the host: user accounts, key hygiene, network exposure, or the configuration files behind the running daemon. So a green exit code is a statement about the negotiated algorithms against a reference, not a verdict on the machine. That distinction matters most in automation, where a script that treats exit 0 as "server is fine" will happily pass a host whose SSH is strong but whose account hygiene is poor. Pair the exit code with the human review of the printed recommendations.

The docker image drops root privileges and exposes 2222 for client mode

The container build is worth a look because it shows how the maintainers think about running a network tool safely. The Dockerfile uses a scratch stage to copy ssh-audit.py and src/ into a python:3-alpine runtime, upgrades the apk packages to remediate vulnerabilities, and strips the suid and sgid bits from every file it can find. It exposes port 2222, which is the default listener the client auditing mode needs, and ends by dropping to USER nobody:nogroup before launching python3 /ssh-audit.py. So the container is set up for the -c client listener, and it does not run as root once started. The published image is docker.io/positronsecurity/ssh-audit, and you run it interactively with port 2222 mapped, passing the target address, as in `docker run -it --rm -p 2222:2222 docker.io/positronsecurity/ssh-audit 10.1.1.1`.

Install paths are pip, snap, docker, and Windows binaries, and the version is scraped from globals.py

There are no runtime dependencies, which keeps installation to a single command on Linux or Windows with Python 3.10 through 3.14. Pre-built packages are published for Windows on the Releases page, on PyPI, as a Snap, and on Dockerhub. A detail that explains some packaging surprises: setup.py does not hardcode the version, it parses a VERSION string out of src/ssh_audit/globals.py with a regular expression, and if it only finds a development form like v3.9.1-dev it still packages but prints a warning that you probably should not be shipping that version. That coupling means the version you install follows whatever is in globals.py at build time.

Editorial conclusion

ssh-audit is a good fit if you need a quick, dependency free read on what your SSH endpoints actually negotiate. Do not treat an exit code of 0 as proof the host is safe, remember the algorithm history only covers OpenSSH, Dropbear, and libssh, and keep the DHEat mode pointed at hosts you are allowed to test.

Frequently asked questions

what is ssh audit

ssh-audit is a tool for SSH server and client configuration auditing, written in Python with no dependencies. It grabs the banner, fingerprints the device, software, and operating system, detects compression, and then reports key exchange, host key, encryption, and MAC algorithms along with security information and hardening recommendations.

how to install ssh audit

Use pip3 install ssh-audit, snap install ssh-audit, or pull docker.io/positronsecurity/ssh-audit from Dockerhub. Windows executables are provided on the Releases page. It runs on Linux and Windows and supports Python 3.10 through 3.14, with no dependencies to resolve.

how to use ssh audit

Run ssh-audit localhost for a standard audit, ssh-audit -T servers.txt to sweep many hosts listed as HOST[:PORT] per line, and ssh-audit -c to audit a client, which listens on port 2222 by default. For policy checks use -L to list built-in policies and -P to apply one, and -M to generate a policy file from a target. An exit code of 0 means all algorithms are secure or the policy passed.

ssh audit alternative

ssh-audit is itself the maintained path here: it is the v2.0+ fork of arthepsy/ssh-audit (v1.x) taken over because the original went inactive. It covers both server and client auditing, includes built-in hardening guides and a web front-end at ssh-audit.com, and runs across Linux, Windows, PyPI, Snap, and Docker.

Official sources

  1. Issues
  2. jtesta/ssh-audit on GitHub
  3. License: MIT
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/jtesta-ssh-audit.svg)](https://hysenlabs.com/projects/jtesta-ssh-audit)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/jtesta-ssh-audit.svg)](https://hysenlabs.com/projects/jtesta-ssh-audit)

Was this useful?