ssh
-
[Python] paramiko를 이용한 linux(리눅스) ssh 접속Python/Python for Linux 2018. 5. 13. 22:58
parkmiko : SSH2 연결 라이브러리 import paramiko ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect('host', username='', password='') stdin, stdout, stderr = ssh.exec_command('echo this is paramiko') stdin.close() for line in stdout.read().splitlines(): print(line.decode()) ssh.close() this is paramiko