sshh是一个ssh帮助工具,用于在ssh代理中批量注册ssh私钥
sshh的Python项目详细描述
sshh是一个ssh帮助工具,用于在ssh代理中批量注册ssh私钥。
sshh的主要目的是避免在 在ssh代理中注册的密钥数超过一定数量。当 当服务器设置私钥上限时,超过了密钥尝试的上限 严格的尝试。
通过清除ssh代理中注册的所有密钥并注册 如有必要,或每次输入密码短语。但是,在这种情况下 是多个密钥和服务器,ssh连接可能非常麻烦。sshh使用python的 子进程包以启动新的ssh代理,并进一步调用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代理
(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) $