How to automatically add server to known_hosts ? (and not use md5 fingerprint, as I mean secure way, please not send "auto yes/accept" solutions. I want to bring required credentials from server to machine)
I'd like to update automatically my ssh known_hosts
file to accept new server.
I assume, that I need to add server's public key (id_rsa.pub
obtained through secure channel), but what I see is that format is different (I've tried adding like this awk '{print "server "$1" "$2}' id_rsa.pub > .ssh/known_hosts
with verification failed. Please note that I don't want to use md5 fingerprint due to flaws in md5). If something else than id_rsa.pub
would be useful I can run commands on server and obtain results though trusted channel. (Please note that it is not network channel (think of physically bringing pendrive from place to another), so ssh-keyscan
does not solve the problem, what's more id_rsa.pub is key of dropbear server that is not running at server, so only files with keys are available, not server)