sanku has asked for the wisdom of the Perl Monks concerning the following question:
hi Error code in error_log for httpd is Mon Aug 11 11:17:36 2008 error client 1.4.1.7 pty_allocate(nonfatal): getpt(): No such file or directory at /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/IO/Pty.pm line 24., referer: http://1.4.1.7/cgi-bin/ssh.pl Mon Aug 11 11:17:36 2008 error client 1.4.1.7 pty_allocate(nonfatal): openpty(): No such file or directory at /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/IO/Pty.pm line 24., referer: http://1.4.1.7/cgi-bin/ssh.pl Mon Aug 11 11:17:36 2008 error client 1.4.1.7 pty_allocate(nonfatal): open(/dev/ptmx): Permission denied at /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/IO/Pty.pm line 24., referer: http://1.4.1.7/cgi-bin/ssh.pl Mon Aug 11 11:17:36 2008 error client 1.4.1.7 Cannot open a pty at /usr/lib/perl5/site_perl/5.8.5/Net/SCP/Expect.pm line 172, referer: http://1.4.1.7/cgi-bin/ssh.pl=code is as follows. #########code1############ #!/usr/bin/perl print "Content-type:text/html\n\n"; print "<html>"; print "<head>"; print "</head>"; print "<body>"; print "<form name=frm method=post action=sshcgi.pl>"; print "<select name=ip>"; print "<option ip=1>1.4.1.7</option>"; print "<option ip=2>1.1.5.87</option>"; print "<option ip=3>22.6.15.1</option>"; print "</select>"; print "<input type=password name=password>"; print "<input type=submit name=submit value=Submit>"; print "</form>"; print "</body>"; print "</html>"; ################################## ##############code-2############## if($ENV{'REQUEST_METHOD'} eq 'POST') { read(STDIN,$buf,$ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buf); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1 +))/eg; $in{$name} = $value; if($value =~ /^\d{2,3}\.\d{2,3}\.\d{2,3}\.\d{2,3}$/){ +$ip=$value;} elsif($value !~ /\d{2,3}\.\d{2,3}\.\d{2,3}\.\d{2,3}/ & +& $value !~ /Submit/){$pwd=$value; } } } chomp($ip,$pwd); use Net::SCP::Expect; $scpe= Net::SCP::Expect->new; $svr = "root\@$ip"; $user='root'; $file ='app_talkdetect.so'; $scpe->login("$user","$pwd"); $scpe->scp("$svr:/home/$file", "/home/"); print "....done\n"; ######################################
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SCP with cgi script doubt
by davorg (Chancellor) on Aug 08, 2008 at 13:43 UTC | |
|
Re: Net::SCP with cgi script doubt
by jethro (Monsignor) on Aug 08, 2008 at 13:29 UTC | |
by sanku (Beadle) on Aug 11, 2008 at 04:24 UTC |