The hostname that shows up in your macOS Terminal prompt is set when you first configured the machine, but you're not stuck with it. scutil is the right tool: scutil --get HostName reads it, scutil --set HostName My-New-HostName writes it. The change is immediate in new shells — no reboot needed in the common case.
The full post walks through opening Terminal, checking the current value, setting a new one, verifying, and the rare case where a reboot is required. Useful if you've inherited a generic Andreas-MacBook-Pro and want something that's actually yours.
Originally published at andreasbergstrom.dev — read the full post there.
Top comments (4)
The actual step that makes the change is missing:
scutil --set HostName My-New-HostName
Wow, somehow I removed that part... Thanks!
Okay, so where is step three ?
Removed by misstake, should be back now