From c33f10c2e1bc8f6ae6b0513ac04a999cd47137ca Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Wed, 24 Sep 2025 23:53:57 +0300 Subject: [PATCH] =?UTF-8?q?Python:=20=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D1=80?= =?UTF-8?q?=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D1=81=20`paramiko`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/Python/paramiko/ssh.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 code/Python/paramiko/ssh.py diff --git a/code/Python/paramiko/ssh.py b/code/Python/paramiko/ssh.py new file mode 100644 index 0000000..58100da --- /dev/null +++ b/code/Python/paramiko/ssh.py @@ -0,0 +1,15 @@ +from paramiko.client import SSHClient + +def main() -> None: + client = SSHClient() + client.load_system_host_keys() + client.connect(hostname='92.63.105.65', username='alex', key_filename='/home/user/.ssh/kvm5') + stdin, stdout, stderr = client.exec_command('ls -l') + print('stdin', dir(stdin)) + + print('stdout', stdout.read().decode('utf-8')) + + print('stderr', dir(stderr)) + +if __name__ == '__main__': + main()