Skip to main content

SSH Config — SSH Adapts to Your Current Network

https://pepy.tech/badge/sshconfig/month https://img.shields.io/readthedocs/sshconfig.svg https://img.shields.io/pypi/v/sshconfig.svg https://img.shields.io/pypi/pyversions/sshconfig.svg
Author:

Ken Kundert

Version:

2.3

Released:

2026-11-12

Installation

Requires Python3.6 or newer.

You can download and install the latest stable version of the code from PyPI using:

pip3 install --user sshconfig

You can find the latest development version of the source code on Github.

Introduction

SSH Config generates an SSH config file adapted to the network you are currently using. In this way, you always use the fastest paths available for your SSH related activities (sshfs, email, vnc, mercurial, etc.). You can also easily reconfigure SSH to make use of proxies as needed or select certain servers or ports based on your location or restrictions with the network.

The following situations are supported:

  1. You may give the mac address or addresses for your router or routers and your network will automatically be recognized.

  2. You can configure which hostname or IP address is used for a particular host depending on which network you are on. In this way you always use the fastest connection available for each host.

  3. You can specify that certain hosts are hidden behind other hosts, so that a SSH proxy should be used to access them.

  4. You can specify port forwarding information for each host. Then, two SSH configurations will be created for those hosts, one that includes port forwarding and one that does not. That way, once the port forwards are established, you can open additional shells on that host without SSH trying to create conflicting port forwards.

  5. You can enter multiple hostnames or IP addresses and give their locations. Then, if you specify your location, the closest server will be used automatically.

  6. You can specify proxy configurations and specify that one should be used for all hosts not on your current network.

  7. You can specify port restrictions and have SSH work around them if possible (if your server supports alternative ports).

  8. You can configure a default location, proxy, or set of port restrictions for each of your known networks.

  9. Once host names are defined, they do not change even though you are using different configurations (different networks, locations, proxies, and port restrictions). In this way you can hard code your host names in applications such as Mercurial or Git, and they automatically adapt to your existing network.

  10. The entire application, including the configuration files, are Python code, so you have considerable freedom to change the configuration based on things like the name of the machine or the user when generating the SSH config file.

Documentation

You can find documentation at ReadTheDocs.

Issues

Please ask questions or report problems on Github Issues.

Contributions

Contributions in the form of pull requests are welcome.

Metadata

Release files for sshconfig 2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sshconfig 2.3
File Size Uploaded Provenance Actions
sshconfig-2.3.tar.gz 32.1 kB Without provenance Details for sshconfig-2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sshconfig 2.3
File Interpreter ABI Platform Actions
sshconfig-2.3-py3-none-any.whl Python 3 none any Details for sshconfig-2.3-py3-none-any.whl

Total release size: 68.9 kB

Release files / sshconfig-2.3.tar.gz

Download URL sshconfig-2.3.tar.gz
Size 32.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1b44ce16ed8a90848d1bacee5b4cbd584c7a28014dba4e838d2e8223a0282556
BLAKE2b-256 checksum
How to use checksums
4c9e6afecc7b3286e0e2f088f0dc2622465cdcb0609a8ca0c534e15935d62b10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / sshconfig-2.3-py3-none-any.whl

Download URL sshconfig-2.3-py3-none-any.whl
Size 36.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53310c8c12c7723391a4a3e7013c9968f269c5313ed1b4fe4150f4b5263fe0dc
BLAKE2b-256 checksum
How to use checksums
04096de044b59bfce40670b5d6a47dd5ff3cca88399114f4206df0743458c75f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for sshconfig 2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page