When opening the macOS terminal, it displays "unused-nctmsb" instead of the name of my MacBook Pro.
Last login: Tue Feb 26 11:42:01 on ttys000
unused-nctmsb:~ kiley$
The terminal still seems to function normally. Completely quitting the terminal application does not help, but sometimes rebooting sets it back to normal for a while. Eventually, it will go back to displaying "unused-nctmsb" as the computer name.
What causes this? Should I be concerned? How can I fix it?
This is nothing to worry about from a security standpoint -- It may indicate networking trouble.
The text you're seeing there is the hostname for your machine, which may be set by your DNS server. The fact that you're seeing "unused-nctmsb" may mean that your DNS server thinks your current IP belongs to that machine.
You can check your hostname from the terminal by typing:
hostname
The easiest way to set the hostname for your machine is to rely on macOS behavior of setting the hostname equal to the computer name by default.
Go to Apple Menu > System Preferences > Sharing and type your desired hostname into the Computer Name field.
Set the hostname, you may do so from the terminal, using the "hostname" command :
hostname <myhostname>
As noted in man page hostname—
man hostname | more
...this strategy will not survive a reboot, and you're better off using
scutil --set HostName <myhostname>
https://support.apple.com/guide/mac-help/find-your-computers-name-and-network-address-mchlp1177/mac