python ssh登陆模块_Python sshh包_程序模块 - PyPI - Python中文网
sshh是一個(gè)ssh幫助工具,用于在ssh代理中批量注冊(cè)ssh私鑰。
sshh的主要目的是避免在
在ssh代理中注冊(cè)的密鑰數(shù)超過(guò)一定數(shù)量。當(dāng)
當(dāng)服務(wù)器設(shè)置私鑰上限時(shí),超過(guò)了密鑰嘗試的上限
嚴(yán)格的嘗試。
通過(guò)清除ssh代理中注冊(cè)的所有密鑰并注冊(cè)
如有必要,或每次輸入密碼短語(yǔ)。但是,在這種情況下
是多個(gè)密鑰和服務(wù)器,ssh連接可能非常麻煩。sshh使用python的
子進(jìn)程包以啟動(dòng)新的ssh代理,并進(jìn)一步調(diào)用ssh add來(lái)集體注冊(cè)
盡可能多的私鑰。這使你免去了麻煩。
用法
初始值(.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.
注冊(cè)鍵(.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
調(diào)用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) $
歡迎加入QQ群-->: 979659372
推薦PyPI第三方庫(kù)
總結(jié)
以上是生活随笔為你收集整理的python ssh登陆模块_Python sshh包_程序模块 - PyPI - Python中文网的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 编写五子棋程序时如何添加下棋时的音效_干
- 下一篇: 发布json数据_数据库每周国际新闻 2