Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I need your help please... Before i post my question i just wanted to let you know that I'm a beginner in perl. My question is : I'm using Net::SSH::Expect in my code to perform remote filesystem mounting. Remote mounting work's fine but sometime i get a "SSH known_hosts verification key" on the target host during the times I'm unable to execute the remote command's as the code skips the command. Is there any way I skip this yes/no host authenticate key question during remote ssh login thro' Net::SSH::Expect module ?

Replies are listed 'Best First'.
Re: known_hosts verification disable
by salva (Canon) on Mar 22, 2011 at 14:41 UTC
    Read the StrictHostKeyChecking entry on the ssh configuration man page (ssh_config(5)).

    Though, note that changing that setting may impact the security of SSH.

      I don't want to change that file as it will effect the settings for all users. Is there any option i can use from perl ssh expect module. While reading thro' Expect.pm module i can see ssh_option as below but i'm not sure how to make use of it for using any ssh options. use fields qw( host user password port no_terminal escape_char ssh_option raw_pty exp_internal exp_debug log_file log_stdout restart_timeout_upon_receive timeout terminator expect debug next_line before match after binary );
        something like...
        ssh_option => '-o StrictHostKeyChecking=no'
        ...should do.