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
In reply to Net::SSH::Perl Module Problem by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |