且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Net::SSH::Perl 使用转发的 SSH 密钥

更新时间:2023-12-05 13:30:10

连接堡垒服务器时必须开启代理转发:

You have to enable agent forwarding when connecting to the bastion server:

my $ssh = Net::SSH::Perl->new(
    $host,
    debug          => 1,
    identity_files => \@KEYFILE,
    options        => [
        'ForwardAgent yes',
    ],
);

有关其他 ssh Perl 模块及其优缺点,请参阅 Net::OpenSSH 与 Net::SSH:: 模块.

For other ssh Perl modules and their pros and cons see Net::OpenSSH vs Net::SSH:: modules.