Skip to main content

Network-aware SSH config profile selector

Project description

SSH Profile

PyPI version

Network-aware SSH config profile selector

Features

  • Network-aware profile selection -- detect which profile applies on the current network and use it as an ssh_config Match exec predicate.
  • Four detection tiers, evaluated as a first-match-wins cascade: hostname, cidr (wired IPv4), gateway_mac, and ssid.
  • Safe by design -- predicate mode is silent on stdout; lenient runtime loading fails toward the conservative unknown profile; a broken ssh-profile fails the connection loudly rather than misconnecting.
  • Validation built in -- --check-config checks the profile data file and your ~/.ssh/config references; --check-tools checks ip/ping/iw.
  • Fast -- a short-TTL cache speeds up the burst of ssh-profile invocations generated by an ssh connection; the initial network detection is shared across the burst.
  • One shared config across machines: a ~/.ssh/config + ssh-profile.toml pair, with no per-machine drift.

Documentation

API documentation is auto-generated from docstrings.

Development

To set up for local development:

# Clone the repository
git clone git@gitlab.com:sck/ssh-profile.git SSH-Profile
cd SSH-Profile

# Create a virtual environment and install all development dependencies
make venv
source venv/bin/activate
make init
make uv.lock
make sync-devci

Run quality checks (format, lint, type check, test):

make qa

Release cycle

  1. Edit code and add change notes to the Next Release (TBD) entry in HISTORY.md as you go.

  2. When ready to release, upgrade all dependencies and refresh the environment:

    make update
    make sync-devci
    
  3. Run the full quality check suite:

    make qa
    
  4. In HISTORY.md, replace the Next Release (TBD) heading with the release version and today's date, and verify the change notes are complete.

  5. Sync the version to pyproject.toml and uv.lock:

    make set-version
    
  6. Commit the release:

    git commit -am "Release X.Y.Z"
    
  7. Tag and push. make tag validates version consistency across HISTORY.md, pyproject.toml, and uv.lock; creates an annotated tag; pushes it to origin; and adds a new Next Release (TBD) entry to HISTORY.md:

    make tag
    

    Pushing the tag triggers the GitLab CI/CD publish job, which uploads the package to your selected registry.

  8. Commit to open the next development cycle:

    git commit -am "Start next development cycle"
    
  9. Go back to step 1.

See Release Checklist for the full recurring workflow.

Author

SSH Profile was created in 2026 by Scott Karlin.

Built with Cookiecutter and the sck/cookiecutter-pypackage-gitlab project template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssh_profile-0.1.0.tar.gz (34.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ssh_profile-0.1.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file ssh_profile-0.1.0.tar.gz.

File metadata

  • Download URL: ssh_profile-0.1.0.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ssh_profile-0.1.0.tar.gz
Algorithm Hash digest
SHA256 326910777548585301a6cb5f7850f29ad1a71989e4634cc164f8a5aaeefc01f1
MD5 3dde1ce0e2706f9d2579aa5e934904e7
BLAKE2b-256 b4468590bf0bc850714f9db439b19732633a0b88ad8fcd9f5d13dbcb02669c77

See more details on using hashes here.

File details

Details for the file ssh_profile-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ssh_profile-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ssh_profile-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1111b705142271715e06825e597e27bf1ce4ed68ad624ff27ee1f944de76c774
MD5 1ca8c2be2e8493eca1b67d98f648179b
BLAKE2b-256 c21dbefde0279bb6314ee07fdce65028009c89a19825188e34648185f2e548e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page