2012. 3. 7. 15:02
프로그래밍/파이썬
import paramiko
from paramiko import AutoAddPolicy
client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(AutoAddPolicy())
client.connect(hostname='접속주소', username='아이디', password='패스')
stdin, stdout, stderr = client.exec_command('ls -l')
print stdout.read()
client.close()
====================================================
접속해서 명령어를 실행하는 간단한 예
from paramiko import AutoAddPolicy
client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(AutoAddPolicy())
client.connect(hostname='접속주소', username='아이디', password='패스')
stdin, stdout, stderr = client.exec_command('ls -l')
print stdout.read()
client.close()
====================================================
접속해서 명령어를 실행하는 간단한 예