Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

changing computer name

Hello,

I have a clean install of leopard. I also signed up for the trial .mac account (I'm not sure if this is affecting anything).

I want to change the name of the computer.
So I go to the preference pane and sharing and change the name.
But when I start the terminal, it shows the old compute name:
(old computer name):~ (username)$

Am I missing something. Which computer name is correct what it says in the shell in terminal or what the sharing preference pane is telling me (new name).local

I know I have changed the name successfully in the past few days, I don't know why it's stuck now.

This is the last time I want to change the name! The reason I want to change it is because the old name has my name in it and I don't want to connect to a network and have people identify me (nothing subversive just privacy! I'm a teacher and I don't want students trying to hack my notebook because they realize it's mine).

My account is an admin account.

Thank you for any help.

MacBook Pro 2 GHz core duo, Mac OS X (10.5.1)

Posted on Nov 24, 2007 12:17 PM

Reply
Question marked as Best reply

Posted on Nov 24, 2007 12:19 PM

You can change the computer name in the "Sharing" Preference Pane at the top in the field labeled "Computer Name". Try fixing permissions to see if that will let the new name implement somewhere. It should change the terminal settings.
18 replies

Nov 24, 2007 1:22 PM in response to counterpt

I've hunted around, and I can think of two things.

1. Terminal is weird. It doesn't respect the hostname set in the Sharing pane, but if you issue the command

sudo hostname <new host name>

quit Terminal, and then reopen the application, the new hostname should appear. From what I can tell, the name in the Sharing pane is the one displayed on the network. I don't know why the two names are disconnected in Leopard.

2. It may be the case that your computer, when connected to the network, is assigned a hostname by the DHCP server. If so, then you need to contact the system administrator and request that your hostname be changed at the server level.

Nov 24, 2007 1:34 PM in response to Will Bridewell

'Terminal' app is a bit different. The default prompt shows the hostname as it resolve from DNS (or whatever service you use to resolve hostnames).

You can do a 'man bash' to see the manual page for the bash shell (the man page for bash is very long) and keep paging down until you find the definition of 'PS1' (which is the default host prompt for the bash shell). You can type (in the Terminal window shell prompt) "echo $PS1" to see the current value of the PS1 variable. Mine looks like this:

\h:\W \u\$

The "\h" part resolves to display whatever the 'hostname' command would have printed UP TO THE FIRST "." (ie. it wont display the domain name. It's as though you typed 'hostname -s' in the terminal to view the hostname.). If you changed it to "\H" (upper case 'H') then it would display the entire hostname.

You can use the 'hostname' command to change the hostname, but this will not be saved permanently (if you reboot it will revert back to whatever it was).

Since the displayed hostname is actually based on DNS (or whatever network name service you happen to use) if someone wanted to contact your computer they could use that name or they could use the the name you provided in the 'Sharing' panel of system preferences.

Nov 24, 2007 1:41 PM in response to Tim Campbell1

For me the Terminal echoes whatever I put in the computer name field, regardless of whether or not I'm connected to a network. This guy's problem is that the terminal name is not changing, and I suspect something in his OS X configuration is preventing the computer name he inputs from being written to the configuration file that defines the hostname, so when bash looks up \h for the hostname, it doesnt get a changed value. This behavior is unlike my system, which does change the hostname according to what I type in for the computer name.

Dec 16, 2007 8:45 AM in response to counterpt

I think it is too late to avoid the reinstall and it will not solve your issue, but you can try the following.

Go into your network settings and change "using DHCP" from dynamic to "Using DHCP with manual address" input a new address and that should fix it. The culprit is the router that it is pulling the old name therefore forcing the router to clear its "cache" will change the name, also restarting might work. The end result is that having the name be different is of no consequence except to us people that like things neat.

Jan 13, 2008 9:06 AM in response to counterpt

Are you trying to change the short account name? If so, it cannot be changed. I think this is the name that appears in Terminal.

You can right click on the name of the hard drive on the desktop and change its name.

You can go into System Preferences and change the name of the shared device by clicking on "Edit" button in the Sharing window.

Jan 13, 2008 10:42 AM in response to Russa

Hi Russa

Russa wrote:
Are you trying to change the short account name? If so, it cannot be changed.


In Leopard, you can change your shortname but it is to be done with extreme caution.

System Preferences>Accounts.
Click padlock & authenticate to unlock (if locked)
Right-click name of your Admin account in left-hand list.
Click Advanced Options.

Stuff you can change:

UID
Group ID
Short Name
Login Shell
Home Directory
UUID
Aliases

Like I said, this requires extreme caution (read warning at top of that window).

Jan 13, 2008 11:53 AM in response to SteveLamb0

SteveLamb0 wrote:
Hi Russa

Russa wrote:
Are you trying to change the short account name? If so, it cannot be changed.


In Leopard, you can change your shortname but it is to be done with extreme caution.

System Preferences>Accounts.
Click padlock & authenticate to unlock (if locked)
Right-click name of your Admin account in left-hand list.
Click Advanced Options.

Stuff you can change:

UID
Group ID
Short Name
Login Shell
Home Directory
UUID
Aliases

Like I said, this requires extreme caution (read warning at top of that window).

Yes, this is a new Leopard feature to be used with caution.
Also, when changing computer name, I believe TM will have to start a new backup file from scratch, since the computer name is the subdirectory name that TM uses for backup purposes.

changing computer name

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.