Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: How can I connect to a Linux Machine from a Windows Box

by marto (Cardinal)
on Apr 05, 2007 at 12:20 UTC ( [id://608464]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How can I connect to a Linux Machine from a Windows Box
in thread How can I connect to a Linux Machine from a Windows Box

You say you connect via putty on your XP machine to these Linux machines. Are you sure you have the correct protocol? Are you actually using SSH? If so take a look at Net::SSH, as mention previously in several of the other replies to your first post in this thread?

Hope this helps

Martin
  • Comment on Re^3: How can I connect to a Linux Machine from a Windows Box

Replies are listed 'Best First'.
Re^4: How can I connect to a Linux Machine from a Windows Box
by blackadder (Hermit) on Apr 05, 2007 at 12:48 UTC
    Hi

    "....Are you sure you have the correct protocol? Are you actually usin +g SSH? "
    Erm, all I know is that I use a Putty session to connect (via port 22, I've just checked it). I enter user= root and the password and hey presto I am in. I want to do just this is in a script!

    Anyway this is what I've tried
    use Net::SSH qw(sshopen2); use strict; my $user = "root"; my $host = "149.195.49.155"; my $cmd = "ls -l"; sshopen2("$user\@$host", *READER, *WRITER, "$cmd") || die "ssh: $!"; while (<READER>) { chomp(); print "$_\n"; } close(READER); close(WRITER);
    And this is what I got!!:
    C:\Scripts>esx_conn3.pl 'ssh' is not recognized as an internal or external command, operable program or batch file.
    An example code would be great.

    Does this help? Cheers.

    Blackadder
      By default SSH runs on port 22, so yes you need to connect using the SSH protocol. Regards example code, did you read the documentation? There are examples there. The error message you are getting is because you have:

      use Net::SSH qw(sshopen2);

      when you want something like:

      use Net::SSH qw(ssh issh sshopen2 sshopen3);.

      Again, read the documentation for a further information and example code.


      Update: Crapola, please ignore the part of this post which has been struck out. Thanks to ikegami for pointing out my mistake.

      Hope this helps

      Martin
        He's not using ssh, issh or sshopen3, so he doesn't need to import those. It looks like the library is trying to use the external utility ssh, but cannot locate it. Is that one of the module's dependacies?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://608464]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (1)
As of 2024-04-24 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found