Last active
March 29, 2016 08:36
-
-
Save v42me/8116b0b3ce077a2ec5d5 to your computer and use it in GitHub Desktop.
python ssh root sudo paramiko
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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