Your best friend for file transfer.

Fetch application logoFetch

New sftp host key (2 posts)

  • Started 8 years ago by greglyon
  • Latest reply 8 years ago from Scott McGuire
  • greglyon Member

    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?

    Thanks

    Posted 8 years ago #

  • Scott McGuire Administrator

    Hi,

    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.

    Scott McGuire
    Fetch Softworks

    Posted 8 years ago #

Reply

  • Or nickname, if you prefer.
  • This will be kept confidential.
  • This is to ensure that you’re a person, not a spambot.