Perl Cgi:如何弹出确认密码

Perl Cgi: How to popup confirm with password

如何弹出确认密码(其他密码与ssh密码不同),然后用ssh执行?

套餐

use CGI qw/:standard/;
use DBI;
use strict;
use Time::Local;
use Net::SSH2;
#use Term::ReadKey; < maybe?

主要代码

my $pw;
my $pws = "1234";

if ($lqcgi->param('sel_cl')){
    $selected_action = $lqcgi->param('sel_cl');
    print "Password: \n"; #How to popup confirm with password. I don't know!
    $pw = <STDIN>;
    chomp ($pw);
    if ($pw eq $pws){
        $ssh2->connect($host{$mxEnv}) or die $!;
        $ssh2->auth_password($usr{$mxEnv},$pwd{$mxEnv});
    }
}

即使我遇到了这个问题,我找到的解决方案就是!使用网络服务器配置文件中的以下条目在我的网络服务器上维护 .htaccess 文件。

如需更多信息,请访问此处 https://httpd.apache.org/docs/2.4/howto/htaccess.html

这将允许 CGI 脚本弹出身份验证弹出窗口并再次验证您的 LDAP(如果 LDAP 已维护),否则您可以使用 remote->user 变量获取用户 ID 并针对数组或文件进行交叉检查.

希望对您有所帮助。

-Shantesh