代码之家  ›  专栏  ›  技术社区  ›  kamal

在创建net::ssh:expect对象时,如何指定stricthostkeychecking=no?

  •  1
  • kamal  · 技术社区  · 14 年前

    类似:

    my %options = (
    debug => 1,
    options => ["ConnectTimeout 3","StrictHostKeyChecking no",],
    );
    
    # Making an ssh connection with user-password authentication
    # 1) construct the object
        my $ssh = Net::SSH::Expect->new (   
        host => $address,
            password=> 'password', 
        user => 'admin', 
        raw_pty => 1,
        log_stdout => 1
        );
    

    上面的似乎不起作用

    3 回复  |  直到 8 年前
        1
  •  4
  •   Community CDub    7 年前

    StrictHostKeyChecking ssh 程序。

    你可以使用 Net::SSH::Expect 选项 ssh_option 在构造函数中:

    my $ssh = Net::SSH::Expect->new(
        # ...
        ssh_option => '-o StrictHostKeyChecking=no',
        # ...
    );
    

    帽子尖 salva .

        2
  •  1
  •   salva    14 年前

    stricthostkeychecking是 ssh程序。阿法克,不可能 在命令行上为ssh设置

    是的,可以!

    使用…

    $ ssh -o StrictHostKeyChecking=no ...
    
        3
  •  0
  •   Raj    8 年前

    ssh-o“stricthostkeychecking=no”-o connectTimeout=1