Search code examples
pythonautomationsshtelnet

Python script - connect to SSH and run command


I already know there are ssh modules for Python, that's not for what I'm looking for. What I want to have is an python script to do the following:

  1. > connect to an [ input by user ] SSH host
  2. > connect using the credentials [ provided by the user ]
  3. > run command on the SSH host [ telnet to [host - input by user ]
  4. > Select menu item in the telnet session

Thanks in advance,

Best regards,


Solution

  • Use paramiko, see http://jessenoller.com/2009/02/05/ssh-programming-with-paramiko-completely-different/ for a through example of using it.