in reply to Re^3: 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
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!"....Are you sure you have the correct protocol? Are you actually usin +g SSH? "
And this is what I got!!: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);
An example code would be great.C:\Scripts>esx_conn3.pl 'ssh' is not recognized as an internal or external command, operable program or batch file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How can I connect to a Linux Machine from a Windows Box
by marto (Cardinal) on Apr 05, 2007 at 12:58 UTC | |
by ikegami (Patriarch) on Apr 05, 2007 at 15:00 UTC | |
by marto (Cardinal) on Apr 05, 2007 at 15:05 UTC |