Skip to content

Instantly share code, notes, and snippets.

@geyang
Last active November 2, 2018 03:34
Show Gist options
  • Save geyang/e28f39cfb4730e96912f98976e5075dc to your computer and use it in GitHub Desktop.
Save geyang/e28f39cfb4730e96912f98976e5075dc to your computer and use it in GitHub Desktop.
how to change the computer name for ssh-keygen after changing the name in Preferences

Just changing the computer name in Sharing doesn't work. if you do ssh-keygen the older computer name still shows up.

In order to change the name of the computer, you need to do the following:

   sudo scutil --set ComputerName "new-name"
   sudo scutil --set LocalHostName "new-name"
   sudo scutil --set HostName "new-name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment