Reboot.py:
[monitor.git] / pyssh / __init__.py
index bc57610..32a34e1 100644 (file)
@@ -15,7 +15,7 @@ version 0.1 of pyssh (http://pyssh.sourceforge.net) by Chuck Esterbrook.
 Licenced under a Python 2.2 style license.  See License.txt.\r
 """\r
 \r
-DEBUG_LEVEL = 0\r
+DEBUG_LEVEL = 1\r
 \r
 import os, getpass\r
 import signal    # should cause all KeyboardInterrupts to go to the main thread\r
@@ -103,8 +103,8 @@ class Ssh:
         self.port = port\r
         self.isopen = 0\r
         self.sshpid = 0  # perhaps merge this with isopen\r
-        self.old_handler = signal.getsignal(signal.SIGCHLD)\r
-        sig_handler = signal.signal(signal.SIGCHLD, self.sig_handler)\r
+        #self.old_handler = signal.getsignal(signal.SIGCHLD)\r
+        #sig_handler = signal.signal(signal.SIGCHLD, self.sig_handler)\r
         \r
     def __del__(self):\r
         """Destructor -- close the connection."""\r
@@ -143,7 +143,8 @@ class Ssh:
         Raises an mysshError if myssh.sshpath is not a file.\r
         Raises an error if attempting to open an already open connection.\r
         """\r
-        self.attach_agent()\r
+        #self.attach_agent()\r
+\r
         if not os.path.isfile(self.sshpath):\r
             raise mysshError, \\r
             "Path to ssh or plink is not defined or invalid.\nsshpath='%s'" \\r
@@ -155,6 +156,7 @@ class Ssh:
             sshargs = '-ssh '\r
         if self.port and self.port != '':\r
             sshargs += PORT_STR + self.port + ' '\r
+        sshargs += " -o StrictHostKeyChecking=no -o PasswordAuthentication=yes -o PubkeyAuthentication=no "\r
         if self.username and self.username !='':\r
             sshargs += self.username + '@'\r
         sshargs += self.host\r
@@ -163,6 +165,7 @@ class Ssh:
         if self.debuglevel:\r
             print ">> Running %s %s." % (self.sshpath, sshargs)\r
         # temporary workaround until I get pid's working under win32\r
+        print sshargs\r
         if os.name == 'posix':\r
             self.sshin, self.sshoutblocking, self.sshpid = \\r
                                 sshpopen2(self.sshpath + ' ' + sshargs)\r