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 查看哈希)
关闭
sshh-0.10.0.tar.gz 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | c55f82be08f0b6af5dddbe56a84c82ea8cdf56455466a701eca8968f3cd2f0af |
|
MD5 | 6d328054d886290484505b87f8e45a6d |
|
BLAKE2b-256 | 9e1ce248f46eeaaf72edc87e2d8700a96edec6f8398ec0c49072fc7618b05cbb |
关闭
sshh-0.10.0-py3-none-any.whl 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 4a928e24dc033eab3c00894d4be69ff35fa208d67dac68befddb5ac1e2df8b07 |
|
MD5 | 947be213dc9506a4ba9c812150311533 |
|
BLAKE2b-256 | 95c89adf45bc26f57a90e618049ecea370111150262c72bd4c34ad872e3ddc87 |