From: Chuck E. <Chu...@St...> - 2002-06-04 18:47:11
|
Julian, I had problems with pyssh where it would have "winning streaks" where it worked fine and "losing streaks" where it didn't. I tried very hard to fix the problems, but was not successful. I ultimately ended up using the non-phrase-protected public/private key scheme to avoid the password/passphrase. You'll either have to do the same, or see if you can fix the code yourself (I already tried). You might also check c.l.p. Perhaps someone has made progress on this since the last time I asked around. Good luck, -Chuck On Tuesday 04 June 2002 11:25 am, Julian Schaefer-Jasinski wrote: > Hi, > > I recently found myself confronted w/ the problem of > remote-controling ssh. Several approaches w/ popen failed due to > password-prompt. When I found your script I tried it - but it didn' t > seem to work for me... obviously I must be doing something wrong... > > TheAddicT@siddhartha:~/swt-miles/proto/engine/ssh> python pyssh.py > command="top -n 0" host=localhost password=<passwd> debug=1 > > >> child says: "TheAddicT@localhost's password: " > >> child took 9 password bytes > >> sleeping 0 secs > >> child took 9 command bytes > >> child response is '2dAKi4xs\r\n\r\ntop -n 0\r\n' > > results = > '<passwd>\r\n\r\ntop -n 0\r\n' > > I use linux 2.4 > Ssh: OpenSSH_2.9p2, SSH protocols 1.5/2.0, OpenSSL 0x0090602f > Any hints would be greatly appreciated. > > I really don' t see what I am missing here. This is what I understand > as the most minimalistic version of your script. Maybe it is obvious > here where my problem lies: > > #!/usr/bin/python > > import os > import sys > import pty > > pid, fd = pty.fork() > if pid == 0: > os.execv("/usr/bin/ssh localhost", [""]) > sys.exit() > else: > #print os.fstat(fd) > os.write(fd, '<passwd>\n') > os.write(fd, 'top -n 0\n') > > print os.read(fd, 1024) > > thanks In advance... > > julian > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- > http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Pyssh-discuss mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyssh-discuss |