--- id: sshconf version: "0.2.7" license: unclear license_treatment: permissive maintenance: active --- # sshconf — Lightweight SSH config library. License: permissive · Maintenance: active · Downloads: 500.0K/mo ## What it is and what it does sshconf is a lightweight library for reading and writing SSH configuration files programmatically. It parses the standard SSH config format and lets you query, add, modify, and remove host entries while preserving the file's original formatting and comments—important because SSH config files are often hand-edited and need to remain readable. The library provides methods to read an existing config, inspect host settings, update individual hosts or create new ones, rename entries, and write changes back to the file or to a new file. It automatically detects indentation from existing config lines and handles multi-value directives like RemoteForward. Since it has no runtime dependencies and requires only Python 3.5 or later, it integrates easily into automation scripts, configuration management tools, or any application that needs to manage SSH access programmatically. Use it for: - Automate SSH host configuration in deployment or infrastructure-as-code scripts. - Build configuration management tools that need to update SSH settings without breaking manual edits. - Generate SSH config entries dynamically from a database or API of hosts and credentials. - Programmatically manage SSH tunnels, port forwards, or jump-host configurations. - Parse and audit existing SSH configs to validate host settings or compliance policies. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. sshconf reads and modifies SSH config files while preserving their formatting and structure, letting you programmatically manage SSH host entries and settings. Yes. sshconf is a straightforward, actively maintained tool with no dependencies, permissive licensing, and a clear use case. Install it if you need to read or modify SSH config files from Python code; skip it if you only work with SSH configs manually or through shell scripts. ## Install pip install sshconf uv add sshconf poetry add sshconf ## Installing sshconf Before you install: No runtime dependencies and a pure-Python wheel distribution keep installation friction minimal. The package is actively maintained with a recent commit history. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions—suitable for most projects. Quickstart: from sshconf import read_ssh_config from os.path import expanduser c = read_ssh_config(expanduser("~/.ssh/config")) print(c.hosts()) c.set("myhost", Hostname="example.com", Port=22) c.save() Verify before relying: - Whether the library handles all SSH config directives and edge cases reliably in production use. - Performance characteristics when working with very large or complex SSH config files. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 500.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags ssh config file parser, modify ssh config programmatically, ssh host management library, parse ssh configuration, ssh config reader writer, ssh-config, system-administration [View on SkillFed](https://skillfed.io/packages/sshconf) · [View on PyPI](https://pypi.org/project/sshconf/)