Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
sshconfig-lint — 基于规则的OpenSSH客户端配置文件检查工具,可检测重复主机、缺失的身份文件、弱算法、通配符排序问题及危险设置,支持JSON输出和CI友好的退出代码。 | Kitploit
工具/GitHubGitHub/noah4ever/sshconfig-lint
通用工具静态分析代码分析配置审计网络安全DevSecOps
GitHubnoah4ever/sshconfig-lint

sshconfig-lint

基于规则的OpenSSH客户端配置文件检查工具,可检测重复主机、缺失的身份文件、弱算法、通配符排序问题及危险设置,支持JSON输出和CI友好的退出代码。

查看仓库
16141天前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

sshconfig-lint

Tests crates.io License: MIT

一个引擎,覆盖你 SSH 配置变更的每一个场景。

sshconfig-lint 可发现 OpenSSH 客户端配置中的语义错误:重复主机、损坏的 identity 路径、不安全的选项、弱算法、通配符排序以及纠缠不清的 Include 链。可在本地、Git hooks、GitHub Actions 和编辑器中复用相同的规则代码。

试用私有浏览器沙盒 · 通过交互式示例学习 · 阅读每条规则

浏览器检查器在你的设备上运行。配置内容不会被上传,也不会收集任何遥测数据。

快速开始

root@kitploit:~
# 检查 ~/.ssh/config
sshconfig-lint

# 检查一个或多个仓库配置
sshconfig-lint .ssh/config infrastructure/ssh_config

# 将警告和错误视为失败
sshconfig-lint .ssh/config --strict

安装

Homebrew

root@kitploit:~
brew tap Noah4ever/tap
brew install sshconfig-lint

Cargo

root@kitploit:~
cargo install sshconfig-lint

Arch Linux

root@kitploit:~
yay -S sshconfig-lint-bin

发布页面 提供了适用于 Linux、macOS 和 Windows 的已验证二进制文件。便捷安装脚本会在安装前校验发布校验和:

root@kitploit:~
curl -fsSL https://raw.githubusercontent.com/Noah4ever/sshconfig-lint/main/install.sh | bash

设置 VERSION=v0.5.0 或 INSTALL_DIR=~/.local/bin 可覆盖默认值。

GitHub Actions

root@kitploit:~
name: SSH config
on: [push, pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: Noah4ever/[email protected]
        with:
          paths: |
            .ssh/config
            infrastructure/ssh_config
          strict: true

发现的问题会以注释形式标注在精确的文件和行号上。该 Action 会下载与其标签匹配的发布版本,并在执行前验证 SHA256SUMS。

对于启用了 GitHub Code Scanning 的仓库,可单独上传 SARIF:

root@kitploit:~
- run: sshconfig-lint .ssh/config --format sarif > sshconfig-lint.sarif
- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: sshconfig-lint.sarif

Pre-Commit

root@kitploit:~
repos:
  - repo: https://github.com/Noah4ever/sshconfig-lint
    rev: v0.5.0
    hooks:
      - id: sshconfig-lint-strict

当警告不应阻止提交时,使用 id: sshconfig-lint。当配置使用其他命名约定时,请在项目中覆盖 files:。

编辑器

从 Marketplace 安装 VS Code 扩展,或运行:

root@kitploit:~
code --install-extension NoahThiering.sshconfig-lint

该扩展会启动 sshconfig-lint lsp,一次性下载匹配的已验证二进制文件,之后即可离线工作。它能识别 .ssh/config、ssh_config 以及 chezmoi 的 dot_ssh/config。不收集任何遥测数据。其源码位于 editors/vscode。

任何支持 LSP 的编辑器都可以启动:

root@kitploit:~
sshconfig-lint lsp

v0.5 语言服务器会在打开、更改和保存时发布整行诊断信息。未命名的缓冲区仅运行内容相关规则;已保存的文件还会解析 Include 和文件系统路径。

输出格式

root@kitploit:~
sshconfig-lint --format text
sshconfig-lint --format json
sshconfig-lint --format github
sshconfig-lint --format sarif

JSON 发现结果包含 severity、code、rule、line、file、message、hint 和 documentation。规则代码和退出码是稳定的自动化接口。

退出码含义
0无错误级发现,且 --strict 下无警告
1至少一个阻塞性发现
2至少一个请求的配置无法读取

规则

规则指南展示了确切的错误片段、修正后的配置、其重要性以及如何使用 OpenSSH 验证结果。

开发

需要 Rust 1.85 或更高版本。

root@kitploit:~
cargo test --all
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt -- --check

参见 CONTRIBUTING.md、公开的 路线图 和 安全策略。

许可证

MIT

下载工具
代码规则严重级别
DUP_HOST重复的 Host 块警告
MISSING_IDENTITYIdentityFile 不存在错误
WILDCARD_ORDERHost 通配符顺序警告
WEAK_ALGO弱算法警告
DUP_DIRECTIVE重复指令警告
INSECURE_OPT不安全选项警告
UNSAFE_CTRL_PATH不安全的 ControlPath警告
INCLUDE_CYCLEInclude 循环错误
INCLUDE_READInclude 无法读取错误
INCLUDE_GLOB无效的 Include 模式错误
INCLUDE_NO_MATCHInclude 未匹配任何文件信息