in reply to Re: Net::SSH::Perl Module Problem
in thread Net::SSH::Perl Module Problem

#!/usr/bin/perl use Net::SSH::Perl; use strict; my $cmd = 'w'; my $host = 'devel.dot.com'; my $user = 'john'; my $ssh = Net::SSH::Perl->new ($host, compression=>1); $ssh->login($user, 'pass'); my ($out, $err, $exit) = $ssh->cmd($cmd); print $out;
This is my perl script which logs to remote machine and executes "w" command . But I need to listen on port 22 to track incoming connections on the remote machine and display messages for the same . Is it possible using the net::ssh::perl module ??? Thanks for ur previous help .

Replies are listed 'Best First'.
Re: Re: Re: Net::SSH::Perl Module Problem
by Grygonos (Chaplain) on Jul 30, 2003 at 15:15 UTC
    you could cron your script up to run every so often? I don't know that port listening was the intended use of Net::SSH::Perl Have a look at what the author says the module does/can do. Then decide if the module is what you need.

    with a socket connection your port 22 is not someone else's port 22, so being able to listen to a port, would just be between the client and the server.

Re: Re: Re: Net::SSH::Perl Module Problem
by nega (Scribe) on Jul 30, 2003 at 16:54 UTC
    Net::SSH::Perl implements a client, not a remote listener. You can't do want you want directly from Net::SSH::Perl. Instead, read the CPAN Documentation for Net::SSH::Perl, look at the $ssh->shell directive and like I and other's have said, grep the information you want out of sshd's log files.