Skip to content

Instantly share code, notes, and snippets.

@mattfoster
Created February 6, 2009 10:20
Show Gist options
  • Save mattfoster/59316 to your computer and use it in GitHub Desktop.
Save mattfoster/59316 to your computer and use it in GitHub Desktop.
import paramiko
cmd = "sudo /etc/init.d/mediatomb restart"
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('microwave', username='matt')
stdin, stdout, stderr = ssh.exec_command(cmd)
print stdout.readlines()
ssh.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment