Metadata-Version: 2.5
Name: lupaxa-ssh-doctor
Version: 0.1.0
Summary: Read-only command-line diagnostics for local SSH client configuration, keys, permissions, and the agent.
Project-URL: Homepage, https://github.com/lupaxa-workstation-toolbox/ssh-doctor
Project-URL: Documentation, https://github.com/lupaxa-workstation-toolbox/ssh-doctor#readme
Project-URL: Repository, https://github.com/lupaxa-workstation-toolbox/ssh-doctor
Project-URL: Issues, https://github.com/lupaxa-workstation-toolbox/ssh-doctor/issues
Author: The Lupaxa Project
License: MIT License
        
        Copyright (c) The Lupaxa Project
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENCE
Keywords: cli,diagnostics,openssh,sre,ssh
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: System :: Networking
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: bump-my-version>=1.2.0; extra == 'dev'
Requires-Dist: hatch>=1.12.0; extra == 'dev'
Requires-Dist: mypy>=1.12.0; extra == 'dev'
Requires-Dist: pip-audit>=2.7.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest-cov>=5.0; extra == 'test'
Requires-Dist: pytest>=8.0; extra == 'test'
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://github.com/lupaxa-workstation-toolbox">
    <img src="https://raw.githubusercontent.com/the-lupaxa-project/brand-assets/master/logos/organisations/workstation-toolbox/readme-logo.png" alt="Workstation Toolbox" />
  </a>
</p>

<h1 align="center">SSH Doctor</h1>

Read-only diagnostics for a local SSH client. SSH Doctor inspects OpenSSH,
configuration, keys, permissions, the agent, and known-host files, then
reports what it found and how to fix it.

It does not change keys, configuration, permissions, known hosts, or the
agent. It does not ask for passphrases.

## Requirements

- Python 3.11 or newer
- macOS or Linux
- OpenSSH client utilities (`ssh`, `ssh-keygen`, `ssh-add`, `ssh-agent`)

## Install

```bash
pip install lupaxa-ssh-doctor
ssh-doctor --help
```

## Commands

```bash
ssh-doctor check
ssh-doctor check --json
ssh-doctor system
ssh-doctor permissions
ssh-doctor keys
ssh-doctor config
ssh-doctor config --host github.com
ssh-doctor agent
ssh-doctor known-hosts
ssh-doctor known-hosts github.com
```

`check` runs the local diagnostics and does not open network connections.
`--verbose` prints extra detail. `--quiet` hides passes and skips.
`--timeout` sets the limit, in seconds, for each external command.

## Output

Each check is `PASS`, `WARN`, `FAIL`, or `SKIP`. A summary line gives the
counts. `--json` prints one document with the version, timestamp, operating
system, results, and summary. Colour is used on a terminal and turned off
when `NO_COLOR` is set.

## Exit Codes

| Code | Meaning                                              |
| :--- | :--------------------------------------------------- |
| 0    | No failures or warnings                              |
| 1    | One or more warnings                                 |
| 2    | One or more failures                                 |
| 3    | Invalid arguments or application configuration       |
| 4    | Diagnostic execution could not be completed          |

Skipped checks alone do not change a successful exit.

## Configuration

An optional TOML file can set the SSH directory, extra key directories,
extra known-host files, enabled or disabled categories, the timeout, the
default output format, and warning identifiers to hide. The file is
`~/.config/ssh-doctor/config.toml`, or the path in `--config` or
`SSH_DOCTOR_CONFIG`. The tool works with no configuration file.

```toml
ssh_directory = "~/.ssh"
timeout = 10
output_format = "text"
disabled_categories = ["agent"]
suppressed_warnings = ["keys.obsolete.id_dsa"]
```

## Development

```bash
make init
make python-install-dev
make python-check
```

<a href="https://github.com/the-lupaxa-project">
    <img src="https://raw.githubusercontent.com/the-lupaxa-project/brand-assets/master/logos/components/footer-for-child-orgs.svg" alt="The Lupaxa Project Footer" width="100%" />
</a>
