Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am using Net::SSH::Perl module to get connected to remote host and execute remote commands . My script is as follows :
This works fine since it gives me the current user's logged in on the remote machine .But now I want to listen to port 22 and whenever a user logs onto port 22 display message saying that this particular user has logged in at this time . I want to display the userid , ip address , time of connection and idle time .#!/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;
Also if a user logs out of port 22 i.e exists I want to display message saying that this particular user has logged out at this time .
I don't know how to use net::ssh::perl module to accomplish the above task .
Please suggest me on the above problem on how to use net::ssh::perl module to listen to a port,track connections made on port 22 and display message .
Thankyou !
update (broquaint): added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SSH::Perl Module Problem
by SyN/AcK (Scribe) on Jul 30, 2003 at 15:21 UTC | |
|
I'm getting tired of SSH questions...
by crenz (Priest) on Jul 30, 2003 at 15:57 UTC | |
|
Re: Net::SSH::Perl Module Problem
by naChoZ (Curate) on Jul 30, 2003 at 17:02 UTC | |
|
Re: Net::SSH::Perl Module Problem
by gnu@perl (Pilgrim) on Jul 30, 2003 at 16:41 UTC | |
by Anonymous Monk on Jul 30, 2003 at 18:22 UTC | |
by gnu@perl (Pilgrim) on Jul 30, 2003 at 19:46 UTC | |
by SyN/AcK (Scribe) on Jul 30, 2003 at 23:22 UTC | |
|
Re: Net::SSH::Perl Module Problem
by nega (Scribe) on Jul 30, 2003 at 14:55 UTC | |
by Anonymous Monk on Jul 30, 2003 at 15:05 UTC | |
by Grygonos (Chaplain) on Jul 30, 2003 at 15:15 UTC | |
by nega (Scribe) on Jul 30, 2003 at 16:54 UTC |