16 lines
430 B
Python
16 lines
430 B
Python
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()
|