Your best friend for file transfer.Fetch
New sftp host key (2 posts)
- Started 10 years ago by greglyon
- Latest reply 10 years ago from Scott McGuire
A server I connect to via sftp has been moved to a new machine that has a new host key, which I have.
How can I get rid of or replace the old host key so that I can connect?
Scott McGuire Administrator
You need to either delete or edit the ~/.ssh/known_hosts file.
To delete the known_hosts file:
1) In the Finder, choose Go > Go to Folder. The Finder will display a prompt.
2) Type "~/.ssh" (without the quotes) into the prompt, and click the Go button. The Finder will display a window showing the contents of the .ssh folder.
3) Select the known_hosts file, and drag it to the Trash.
4) Close the window.
After you delete the file, the new host key will get added back to the known_hosts file automatically.
If you feel you really know what you're doing, you can open the known_hosts file in a text editor and just delete the line that refers to the server. However, since host keys are usually automatically added back to the known_hosts file, it's generally safe to delete it and all your servers will just re-add the keys as you connect to them.
Thanks, and let us know if you have any further questions.
- Page 1