in reply to Run arbitrary UNIX commands on webserver without telnet
Take a gander at SOAP::Lite for more info, also check out $code or die's review on the module.package RPC; sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = { ls => 'ls -la' top => 'top -b -n1' who => 'w' }; return bless $self, $class; } sub exec { my ($self,$cmd) = @_; $cmd = $self{$cmd} || return "bad command\n"; `$cmd`; }
Update: I should mention that if you actually want the user to be able to have 'state', then you need to add sessions - check out Apache::Session. For example, if the user issues 'cd /' and then 'pwd' - the result of the 'pwd' will show that they are back at their home directory, and not root.
But, if they need that - then you really should just use ssh. :)
jeffa
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: (dmm): Run arbitrary UNIX commands on webserver without telnet
by dmmiller2k (Chaplain) on Oct 30, 2001 at 23:26 UTC | |
by jeffa (Bishop) on Oct 30, 2001 at 23:36 UTC | |
by dmmiller2k (Chaplain) on Oct 30, 2001 at 23:43 UTC |