#! /usr/bin/evn perl use warnings; use strict; # get IP address my $realIP = $ENV{'SSH_CLIENT'}; $realIP =~ m/^([\d.]+)/; $realIP = $1; # and hostname my ($hostname,$temp) = split( ' ', $ENV{'SSH_ORIGINAL_COMMAND'}); # if $temp exists, it is the IP $realIP = $temp if $temp; die "You must send hostname with command\n" unless $hostname; # do whatever you want here. # look through $ENV to see what you can access my $OK = &checkPermission(); die unless $OK; 1; # we made it here, so they can issue the command