How do you turn off SSH key checking with NCM backups

Document ID : KB000005255
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

How do you turn off SSH key checking with NCM backups

Environment:
Spectrum 10.x
Cause:

When customers need to turn off SSH key checking for NCM backups.The code doesn't work if you change the certificate. It will not backup, you get a login failure. You then have to login into the spectrum server and login to the bash shell then use "ssh-keygen -R x.x.x.x" to delete the old cached certificate. Then it will backup. 

Resolution:

Use "-o UserKnownHostsFile=/dev/null" along with "-o StrictHostKeyChecking=no" as below: 

my $ssh = Net::SSH::Expect->new ( host => $deviceIP, user => $user, password=> $pass, raw_pty => 1, no_terminal => 1, timeout => $login_timeout, ssh_option => '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' 
); 

This will allow the capture to complete successfully.