tags:

views:

42

answers:

2

Something like:

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
    );

the above does not seem to be working

+4  A: 

StrictHostKeyChecking is an option for the ssh program.

You can use the Net::SSH::Expect option ssh_option in the constructor:

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

Hat tip salva.

Sinan Ünür
A: 

StrictHostKeyChecking is an option for the ssh program. AFAIK, it cannot be set on the command line for ssh

yes, it can!

Use...

$ ssh -o StrictHostKeyChecking=no ...
salva