Whenever you have to connect through SSH to a lot of different servers, and you create a command for it like this:
You may run into an error that stops your command, especially when a new server is added to $SERVER_LIST, like this:# for h in $SERVER_LIST; do ssh $h "uptime"; done
And you'll have to type "yes" every time this error is encountered.The authenticity of host 'myserver (1.2.3.4)' can't be established. RSA key fingerprint is ..... Are you sure you want to continue connecting (yes/no)?
So, how do you automate this, and not have to type "yes" with every new host?
The answer is to disable strict host key checking with the ssh command like this:
Please note that you should only do this with hosts that you're familiar with, and/or are in trusted networks, as it bypasses a security question.ssh -oStrictHostKeyChecking=no $h uptime
If you found this useful, here's more on the same topic(s) in our blog:
- Using a proxy for wget
- Calculating with UNIX timestamps
- Generating a PDF file from a text file on AIX
- Mounting a Windows share on an AIX system
- Sudosh
UNIX Health Check delivers software to scan Linux and AIX systems for potential issues. Run our software on your system, and receive a report in just a few minutes. UNIX Health Check is an automated check list. It will report on perfomance, capacity, stability and security issues. It will alert on configurations that can be improved per best practices, or items that should be improved per audit guidelines. A report will be generated in the format you wish, and the report includes the issues discovered and information on how to solve the issues as well.
Interested in learning more?
Interested in learning more?




