How do you turn off SSH key checking in Spectrum when customers need to turn it off for NCM backups after a certificate change?
DX NetOps Spectrum all currently supported releases
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 SpectroSERVER and login to the bash shell then use "ssh-keygen -R x.x.x.x" to delete the old cached SSH Key. Then it will backup.
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.
Examplemy $ssh = Net::SSH::Expect->new ( host => $deviceIP, user => $user, password=> $pass, raw_pty => 1, no_terminal => 0, timeout => $login_timeout, ssh_option => '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' );