Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting

Thread Tools Rate Thread Display Modes
Old 02-18-2009, 12:03 PM
lazyjim lazyjim is offline
Registered User
Join Date: Feb 2009
Posts: 1
SSH host keys

Is there any way to auto accept new host keys.

I have created a script that will connect to a device, in this case a cisco switch, via ssh2. The script will login the username/pass combo I give it at the beginning. Will verify the connection, run x commands, then close the connection, log the results and move on to the next switch in my list. The script works perfectly. I do however, have an issue with host keys on the switch end.

Not long ago all the switches I am running this script on, were telnet based.
I have since converted everything over to ssh2 with tacacs+. So at this point, I have yet to connect and cache all the host keys.

I have to run this script on multiple switches. multiple being a very high number, I would really like to avoid having to click accept on every new host key dialog box that pops up.

Any thoughts?
Reply With Quote
Old 02-18-2009, 05:22 PM
rtb rtb is offline
VanDyke Technical Support
Join Date: Aug 2008
Posts: 4,306
Hello lazyjim,

If you are using the Connect method for the Session Object, then you could use the following:

crt.Session.Connect "/SSH2 /accepthostkeys hostname"
Does this help resolve the new hostkey issue?

VanDyke Software
Technical Support
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 06:38 PM.