Golang’s SFTP HostKeyCallback
Sep 9, 2018 · 1 min read
I’m sure you’ll probably encounter `Must specify HosKeyCallback` and found this site. If you did, then this is for you. Let me cut the crap and go straight to it. Here’s the complete code that you can use as your helper function if you wish.
No more `ssh.InsecureIgnoreHostKey()`, the above code should work for you both in dev and production.
Note: the credit goes to Parsia’s Den if you wish to know what’s going on. I just pull the code and make it a helper function so that you can continue to work on what you were focusing without spending too much time fixing that `Must specify HosKeyCallback` error (like I did)
