Skip to content

SSH 安全:按 action 选择功能

这个请求地址通过 action 区分具体功能。下方列出每个 action 的参数、约束和调用示例。

POST
https://your-panel.example.com:8888/ssh_security
查看 Markdown

Request bodyX-WWW-FORM-URLENCODEDrequired

One of the following:

  • get_config
  • san_ssh_security

Returns

default

响应因 action 而异,见下方各 action 的详细说明。

各操作详细说明

get_configaction=get_config获取 SSH 安全配置(密钥认证、root 登录、密码登录状态)

获取当前 SSH 安全配置状态。

  • 路由:POST /ssh_security
  • action:get_config

输入参数

参数名称 必选 类型 描述
action 是 String 固定值 get_config

输出参数

参数名称 类型 描述
rsa_auth String RSA 密钥认证状态
pubkey String 公钥认证:yes/no
password String 密码登录:yes/no
root_is_login String root 是否可登录
root_login_type String root 登录方式
root_login_types Object 可选登录方式列表

示例

{
    "rsa_auth": "yes",
    "pubkey": "no",
    "password": "no",
    "root_is_login": "no",
    "root_login_type": "no",
    "root_login_types": {"yes": "可密码和密钥登录", "no": "禁止登录"}
}
san_ssh_securityaction=san_ssh_securitySSH 安全扫描 — 检测 sshd_config 中的安全漏洞

扫描 /etc/ssh/sshd_config 中的安全漏洞,返回风险列表及加固建议。

  • 路由:POST /ssh_security
  • action:san_ssh_security

输入参数

参数名称 必选 类型 描述
action 是 String 固定值 san_ssh_security

输出参数

参数名称 类型 描述
num Integer 检测项总数
result Array 风险列表
result[].id Integer 风险编号
result[].name String 风险名称,如 SSHD 强制使用V2安全协议
result[].level String 危害等级:1=低 / 2=中 / 3=高
result[].Suggestions String 加固建议和具体操作步骤
result[].repaired String 是否可修复:1=可 / 0=不可

示例

{
    "num": 80,
    "result": [{
        "id": 2,
        "name": "SSHD 强制使用V2安全协议",
        "level": "3",
        "harm": "高",
        "repaired": "1",
        "Suggestions": "加固建议:在 /etc/ssh/sshd_config 中设置 Protocol 2"
    }]
}
Navigation

Type to search…

↑↓ navigate↵ selectEsc close