please solve

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shweta mani

    please solve

    hi folks,
    i have been assigned a project on Python. i need to execute a remote
    shell script file from a windows machine through SSH twisted or
    paramiko. if it is a normal file then directly with the command sh
    <filename>.sh it is getting executed.
    self.conn.sendR equest(self, 'exec', common.NS(sh test1.sh), wantReply
    = 1)
    but if a shell scripts asks for user input, this particular way does
    not wait for user input. it just print the echo part .
    is there any way so that interactive type of scripts can be executed
    in Paramiko or Twisted Conch in a windows machine (remote login in a
    unix machine through Paramiko SSH or Twisted)
    i did try with another way in Paramiko which helps in opening a remote
    window by creating an instance of SSHClient and invoking the method
    invoke_shell(wi th some parametes) but remote shell window is not
    opening.the method specifies starts a terminal shell window in SSH
    server.
    To my interpretation it is somewaht opening a terminal window like
    putty.
  • Raymond Cote

    #2
    Re: please solve

    shweta mani wrote:
    hi folks,
    i have been assigned a project on Python. i need to execute a remote
    shell script file from a windows machine through SSH twisted or
    paramiko. if it is a normal file then directly with the command sh
    <filename>.sh it is getting executed.
    self.conn.sendR equest(self, 'exec', common.NS(sh test1.sh), wantReply
    = 1)
    You could take a look at the Fabric project for some ideas as to how to
    do this:
    <http://www.nongnu.org/fab/documentation.h tml>

    --R

    Comment

    • harijay

      #3
      Re: please solve

      On Oct 12, 12:15 pm, Raymond Cote <rgac...@Approp riateSolutions. com>
      wrote:
      shweta mani wrote:
      hi folks,
      i have been assigned a project on Python. i need to execute a remote
      shell script file from a windows machine through SSH twisted or
      paramiko. if it is a normal file then directly with the command  sh
      <filename>.sh it is getting executed.
      self.conn.sendR equest(self, 'exec', common.NS(sh test1.sh), wantReply
      = 1)
      >
      You could take a look at the Fabric project for some ideas as to how to
      do this:
         <http://www.nongnu.org/fab/documentation.h tml>
      >
      --R
      ALso please look at the pexpect module. This allows you to supply
      "human" input to automate scripts that require it.
      Look at http://www.noah.org/wiki/Pexpect#Description_of_Pexpect
      Hope this helps
      Harijay

      Comment

      Working...