Installing mysql-server with python ssh connection

Posted by mrbox on Server Fault See other posts from Server Fault or by mrbox
Published on 2009-11-18T16:16:51Z Indexed on 2010/04/22 12:04 UTC
Read the original article Hit count: 173

Filed under:
|
|

I'm writing a script in Python, which is connecting to server via ssh, then installing some packages. But there is problem with dialogue box, where i can type in a root password- i don't know how to send data there. Once I tried to do this, my apt(using Debian Lenny) gone crazy.

Here is some info: - Debian Lenny - Using PySSH with easier interface, code looks like this:

clientSSH = SSHClient( self.ip, 'root', self.rootPassword, None )
clientSSH.login()
clientSSH.run_command('apt-get install mysql-server mysql-client php5')
clientSSH.run_command('Y')
#I Don't know how send root passwd here
clientSSH.logout()

© Server Fault or respective owner

Related posts about python

Related posts about mysql