Skip to content

Instantly share code, notes, and snippets.

@v42me
Last active March 29, 2016 08:36
Show Gist options
  • Save v42me/8116b0b3ce077a2ec5d5 to your computer and use it in GitHub Desktop.
Save v42me/8116b0b3ce077a2ec5d5 to your computer and use it in GitHub Desktop.
python ssh root sudo paramiko
ssh.connect('127.0.0.1', username='jesse',
password='lol')
stdin, stdout, stderr = ssh.exec_command(
"sudo dmesg")
stdin.write('lol\n')
stdin.flush()
data = stdout.read.splitlines()
for line in data:
if line.split(':')[0] == 'AirPort':
print line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment