Loading ...
Sorry, an error occurred while loading the content.

RE: SFTP and SSH - Does it work in Windows?

Expand Messages
  • Fish, David
    Hello Everyone! Here is an update I sent to Kamal, just an FYI to give you more information. Thanks, David Fish Senior Systems Analyst Property System
    Message 1 of 3 , Dec 3, 2007
    • 0 Attachment
      Hello Everyone! Here is an update I sent to Kamal, just an FYI to give
      you more information.

      Thanks,


      David Fish
      Senior Systems Analyst
      Property System Services
      Work (301) 380-3331
      BlackBerry (301) 646-8985
      david.fish@...

      -----Original Message-----
      From: Fish, David
      Sent: Monday, December 03, 2007 2:53 PM
      To: 'kamal'
      Subject: RE: SFTP and SSH - Does it work in Windows?

      Hello! I switched to attempt using keys instead of a login and
      password, but both of the attempts are failing. This was the basic
      script I was writing to just login to the server using sftp. If I go
      into cygwin shell and type sftp user@ip it connects just fine. There
      error I am getting is:
      Net::SSH: Bad host name: user@ip at C:/Perl/site/lib/Net/SFTP.pm
      line 61

      I looked in the SFTP.pm and it is looking for the login and password. I
      setup my program to provide a login and password and I get the following
      error:
      Can't set socket non-blocking: Bad file descriptor at
      C:/Perl/site/lib/Net/SSH/P
      erl.pm line 216.


      Thanks for your help,

      #Key Code

      use Net::SFTP;
      $host="user\@$ip";

      # Open the FTP Connection to the Mercury ftp server
      if(! ($sftp = Net::SFTP->new($host))) {
      print STDOUT "Net::SFTP Failed: $! for host $host \n";
      return("1");
      }
      else {
      print STDOUT "NET::SFTP Successful $! for host $host\n";
      }

      # Login the user for this connection
      if( ! $sftp->ls) {
      print STDOUT " ls Failed $! ";
      return("2");
      }
      else {
      print STDOUT " ls Successful $! ";
      }


      #User Code
      use Net::SFTP;
      $host="IP";
      $user="user1";
      $passwd="pass1";

      # Open the FTP Connection to the Mercury ftp server
      if(! ($sftp = Net::SFTP->new($host, $user, $passwd))) {
      print STDOUT "Net::SFTP Failed: $! for host $host \n";
      return("1");
      }
      else {
      print STDOUT "NET::SFTP Successful $! for host $host\n";
      }

      # Login the user for this connection
      if( ! $sftp->ls) {
      print STDOUT " ls Failed $! ";
      return("2");
      }
      else {
      print STDOUT " ls Successful $! ";
      }



      David Fish
      Senior Systems Analyst
      Property System Services
      Work (301) 380-3331
      BlackBerry (301) 646-8985
      david.fish@...

      -----Original Message-----
      From: kamal [mailto:kamal2222ahmed@...]
      Sent: Monday, December 03, 2007 1:42 PM
      To: Fish, David
      Subject: Re: SFTP and SSH - Does it work in Windows?

      try using -v and debug, to get a better idea of what errors you are
      getting

      i have Win XP ssh, using Cygwin, working to a Unix host

      -Kamal.
      ----- Original Message -----
      From: "Fish, David" <David.Fish@...>
      To: <perl-win32-users@...>;
      <perl-beginner@yahoogroups.com>
      Sent: Monday, December 03, 2007 1:06 PM
      Subject: SFTP and SSH - Does it work in Windows?


      > Hello! I have been reviewing over several google searches and the use
      > of SSH and SFTP on Windows XP to a Unix box does not look to
      promising.
      > The Unix SSH/SFTP I am using is Cygwin. Has anyone got this to work
      in
      > a Windows to Unix? Am I going down a endless of errors trying to get
      > this to work?
      >
      >
      >
      >
      > David Fish
      > Senior Systems Analyst
      > Property System Services
      > Work (301) 380-3331
      > BlackBerry (301) 646-8985
      > david.fish@...
      >
      > _______________________________________________
      > Perl-Win32-Users mailing list
      > Perl-Win32-Users@...
      > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
    • Amar Subramanian
      I m not sure if this is redundant but I can tell you that I ve had lots of luck using WinSCP. It can use the secure FTP protocol and uses Putty as the SSH.
      Message 2 of 3 , Dec 8, 2007
      • 0 Attachment
        I'm not sure if this is redundant but I can tell you that I've had lots of
        luck using WinSCP. It can use the secure FTP protocol and uses Putty as
        the SSH.



        Amar Subramanian



        _____

        From: perl-beginner@yahoogroups.com [mailto:perl-beginner@yahoogroups.com]
        On Behalf Of Fish, David
        Sent: Monday, December 03, 2007 12:07 PM
        To: perl-win32-users@...; perl-beginner@yahoogroups.com
        Subject: [PBML] SFTP and SSH - Does it work in Windows?



        Hello! I have been reviewing over several google searches and the use
        of SSH and SFTP on Windows XP to a Unix box does not look to promising.
        The Unix SSH/SFTP I am using is Cygwin. Has anyone got this to work in
        a Windows to Unix? Am I going down a endless of errors trying to get
        this to work?

        David Fish
        Senior Systems Analyst
        Property System Services
        Work (301) 380-3331
        BlackBerry (301) 646-8985
        david.fish@marriott <mailto:david.fish%40marriott.com> .com





        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.