跳转到主要内容

sshh 是一个 ssh 辅助工具,用于在 ssh-agent 中批量注册 ssh 私钥。

项目描述

sshh 是一个 ssh 辅助工具,用于在 ssh-agent 中批量注册 ssh 私钥。

sshh 的主要目的是避免当在 ssh-agent 中注册的密钥数量超过一定数量时发生的 ssh: Too many authentication failures 错误。当服务器严格设置私钥尝试的上限时,超出密钥尝试上限将发生此错误。

可以通过清除 ssh-agent 中注册的所有密钥并注册所需数量的密钥,或者每次输入密码来避免此问题。然而,在存在多个密钥和服务器的情况下,ssh 连接可能会非常麻烦。sshh 使用 Python 的 subprocess 包启动一个新的 ssh-agent,并进一步调用 ssh-add 来集中注册所需的私钥数量。这可以减轻您的麻烦。

用法

初始化

(.venv) $ sshh-config init
Enter password for your registry: xxxxx
The registry file ~/.sshh.registry is created.

更改密码

(.venv) $ sshh-config chpw
Enter CURRENT password for your registry: xxxxx
Enter NEW password for your registry: yyyyy
Enter NEW password again for verification: yyyyy
Password has been changed.

注册密钥

(.venv) $ sshh-add -g prod ~/id_rsa_server1
Enter password for your registry: xxxxx
Enter passphrase for the keyfile: yyyyy
The keyfile is registered.

列出密钥

(.venv) $ sshh-add -l
Enter password for your registry: xxxxx
[prod]
/home/user/.ssh/id_rsa_server1
/home/user/.ssh/id_rsa_server2

[stg]
/home/user/.ssh/id_rsa_server7
/home/user/.ssh/id_rsa_server8

调用 ssh-agent

(venv) $ sshh-agent -g prod
Enter password for your registry: xxxxx
Enter password for your registry:
Registering keys for session "prod"
ssh-agent PID=67779 session "prod" has been started. To close this session, exit shell.
[prod] (venv) $
[prod] (venv) $ exit
exit
ssh-agent PID=67779 session "prod" has been closed.
(venv) $

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

sshh-0.10.0.tar.gz (11.4 kB 查看哈希)

上传时间

构建分布

sshh-0.10.0-py3-none-any.whl (13.1 kB 查看哈希)

上传时间 Python 3

支持者