From: Rasjid W. <ra...@op...> - 2003-11-28 14:39:54
|
On Friday 28 November 2003 00:53, Anders Eriksson wrote: > Hello! > > I have just discovered Pyssh 0.2 and I like it! > > There are some things that I can't get to work so I thought I ask you about > it! > > I need to automate creating a ssh connection, running some commands, > checking the results of the commands and then respond depending on the > result, and then closing the connection. This will then be repeated every > two minutes... > > So entiring a password isn't something I want to do every two minutes! > > One of the cool things about Putty and Plink is that I can save a session > and then use the session instead of specifying all params on the command > line. Unfortunally Pyssh doesn't support this. > > I have added this functionallity but I can't get it to take a passphrase. I > don't understad how the login is handled... > > Would someone please explain how Ssh::login works! > logintext what is it used for? I get the question about passphrase before > 'Last login:' > > I'm running Python 2.3 on Windows 2000 > The server is a SunOS 5.8 The login text is the text that the login function looks for that means it stops looking for password prompts / ssh questions etc. It should be set to be the last text before the bash prompt. To achieve the effect you want, just pass a new 'prompt_callback' function to the command. For starts, make a copy of the current _prompt function, and modify it so that it returns the text you want. Is this enough help? If not, let me know and I'll try and explain in more detail. Cheers, Rasjid. -- Rasjid Wilcox Canberra, Australia (UTC +10 hrs) http://www.openminddev.net |