SCP help

From: John Pretti (john_at_web-connected.com)
Date: 05/26/04


To: <beginners@perl.org>
Date: Wed, 26 May 2004 13:53:45 -0500

All,
 
I have developed a CGI that will take information from a CGI based form and
SCP a specific file to a remote server. I am having some troubles and I
think I need to escape something. Anyone have any ideas? Snippet of code is
as follows:
 
# SCP commands
my $scp_cmd = "/usr/bin/scp";
my $scp_opts = "-i /root/.ssh/identity ";
 
# Promote the file to merlin
        system(`$scp_cmd $scp_opts $src_dir/*
rdwebadmin\@x.x.x.x:/$directories_map{$q->param("promdir")}`);
 
Error:
Wed May 26 13:47:47 2004] promote.cgi: Execution of
/www/web/cgi-sec/merlin/promote.cgi aborted due to compilation errors.
Warning: Identity file /root/.ssh/identity does not exist.
Host key verification failed.
lost connection
[Wed May 26 13:48:55 2004] [error] [client 199.159.140.172] Premature end of
script headers: /www/web/cgi-sec/merlin/promote.cgi
 
If I do the above command from the command line all works perfectly. Thanks
in advance.
 
Regards,
John



Relevant Pages

  • RE: SCP help
    ... > I have developed a CGI that will take information from a CGI based ... > SCP a specific file to a remote server. ... > If I do the above command from the command line all works perfectly. ... Is the script setuid? ...
    (perl.beginners)
  • Re: SCP help
    ... > I have developed a CGI that will take information from a CGI based ... > SCP a specific file to a remote server. ... > If I do the above command from the command line all works perfectly. ...
    (perl.beginners)
  • Re: scp. I dont get it
    ... allows you restrict the use of the key to a specific ip, ... only use scp, and even then, only if the destination includes ... or running a cron script to do it for you. ... # original scp command given by the client. ...
    (comp.os.linux.security)
  • Re: scp exploit
    ... want scp, but not necessarily the ability to pass in commands. ... server's running a restricted shell then the shell ought to filter the ... from sending a command string via ssh containing ";" (or any other shell ...
    (comp.security.ssh)
  • RE: Can System() of Perl be bypassed?
    ... If you need to send or receive output of your 'system' command, ... This CGI would be the ... You should do some minimal sanity check on searchstring. ... Then your grep line reads ...
    (SecProg)