Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Net::SCP::Expect RSA Fingerprint Problem

by salva (Abbot)
on Jan 11, 2013 at 08:28 UTC ( #1012827=note: print w/replies, xml ) Need Help??


in reply to Net::SCP::Expect RSA Fingerprint Problem

If the option StrictHostKeyChecking=no is passed to OpenSSH ssh client and no key exists on the known_hosts file for the target host, it will accept as good (and remembered for future connections) the first one received from the remote host.

Though, I don't see how extra options for ssh can be passed through Net::SCP::Expect.

Anyway, you can use Net::OpenSSH instead:

$ssh = Net::OpenSSH->new($host, user => $user, password => $password, master_opts => [-o => 'StrictHostKeyChecking= +no']); $ssh->scp_put(...); $ssh->scp_get(...);

Note that disabling strict host key checking has some security implications that you should be aware of.

Replies are listed 'Best First'.
Re^2: Net::SCP::Expect RSA Fingerprint Problem
by anshumangoyal (Scribe) on Jan 11, 2013 at 08:41 UTC
    Even Net::SCP::Expect has this option. This is how you pass this:
    my $scp_exp = Net::SCP::Expect->new( host => $host, user => $user, password => $pass, timeout => undef, auto_yes => 1, recursive => 1, option => 'StrictHostKeyCheck +ing=no' );
    Thanks for the Great Help. This worked like a charm!!
      I must admit I do like to see feedback from the original question poster indicating which solution to the problem actually worked for them. Thanks for updating us.
      A Monk aims to give answers to those who have none, and to learn from those who know more.
      How can I give the options 'StrictHostKeyChecking=no' and 'UserKnownHostsFile=/dev/null'? auto_yes => 1 is working only with option => 'StrictHostKeyChecking=no'.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1012827]
help
Chatterbox?
[Corion]: We went to visit the "recently" (1975?) active volcano on La Palma but the landscape was underwhelming, at least when compared to the (cold) lava fields on Lanzarote
[choroba]: Yes, the volanos park was extraordinary
[Your Mother]: ....I had a nightmare about rock hunting on a volcanic field last night....
[LanX]: Rocks are dangerous to hunt when they suddenly attack you...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2018-02-23 16:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (303 votes). Check out past polls.

    Notices?