LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Warning: the DSA host key for '' differs from the key for the IP (https://www.linuxquestions.org/questions/linux-newbie-8/warning-the-dsa-host-key-for-differs-from-the-key-for-the-ip-939113/)

medirecpr 04-10-2012 11:15 AM

Warning: the DSA host key for '' differs from the key for the IP
 
I have to connect to two different URLs, which share the same IP address. The first one I connected to worked fine, and still does. The second one give the following message:


Warning: the DSA host key for 'URL' differs from the key for the IP address 'xxx.xxx.xxx.xxx'

The system asks whether i wish to proceed, I answer yes, and it connects just fine.

However, i have automated SFTP process that will login in the same manner... SSH? So the first one I tried works fine, but the second fails because I would need to supply a "Yes" during the automated process.

My question is, can I add the second URL to the key that currently has the first URL and corresponding IP?

Kindest regards to all,

suicidaleggroll 04-10-2012 11:47 AM

You can use the StrictHostKeyChecking option in SSH to ignore the check and proceed anyway:

Code:

ssh -o StrictHostKeyChecking=no user@ip

medirecpr 04-10-2012 05:24 PM

permanently ignore the check?
 
Quote:

Originally Posted by suicidaleggroll (Post 4649409)
You can use the StrictHostKeyChecking option in SSH to ignore the check and proceed anyway:

Code:

ssh -o StrictHostKeyChecking=no user@ip

Can I turn this off permanently? a setting perhaps, so it does not use the StrictHostChecking at all? I trust the servers I am connecting to.

Thanks for the info,

suicidaleggroll 04-10-2012 05:28 PM

Not sure if you can globally disable it, but you can always add an alias so every time you type "ssh", it actually runs "ssh -o StrictHostKeyChecking=no".

medirecpr 04-10-2012 05:39 PM

cause i won't be typing it in, its a php program that executs the connection. I'm looking at the code to see if i can squeeze that stricthostchecking=no. but don't think its so straight forwards. I see where the code ... i'll dig deeper and post again, when i know what to post.

thanks a million!

Geremia 10-12-2014 10:20 AM

Just correct the corresponding hostname in ~/.ssh/known_hosts.


All times are GMT -5. The time now is 11:02 PM.