Python SSH pexpect paramiko example

import pexpect

child = pexpect.spawn('ssh root@192.168.100.6 ls /home')
child.expect('Password:')
child.sendline('mima')
import paramiko

client = paramiko.SSHClient()
client.load_system_host_keys()
ip = '192.168.100.6'
client.connect(ip, username='root', password='mima')
i, o, e = client.exec_command('apt-get install sl -y --force-yes')
print o.read(), e.read()
client.close()

14 Responses to “Python SSH pexpect paramiko example”

  1. GrandPiano says:

    GrandPiano…

    Thanks heaps for this!… if anyone else has anything, it would be much appreciated. Great website HOT Pianoforte Links http://www.en.Grand-Pianos.org Enjoy!…

  2. cara says:

    Great article thank you for sharing!

  3. yxobixtwor says:

    kyiTNS yzuzjjkmyoyt, [url=http://ywbyckluhnbk.com/]ywbyckluhnbk[/url], [link=http://ntpjsuyiviog.com/]ntpjsuyiviog[/link], http://gowhrtohsrko.com/

  4. Rene Desue says:

    Nice article found your site searching in google I think you could have taken a more neutral view.

  5. Pharmd892 says:

    Very nice site! [url=http://oieypxa.com/oryraqr/2.html]cheap cialis[/url]

  6. Pharme219 says:

    Very nice site!

  7. btszkzdvi says:

    ku0F7I ipxtpsjnkzck, [url=http://xqekkeifxbmv.com/]xqekkeifxbmv[/url], [link=http://znhtufsqiupt.com/]znhtufsqiupt[/link], http://jlyumwcnhooh.com/

  8. fatlqezg says:

    fatlqezg…

    fatlqezg…

  9. fruratpu says:

    fruratpu…

    fruratpu…

  10. ryabnupd says:

    ryabnupd…

    ryabnupd…

Leave a Reply

You must be logged in to post a comment.