 |
 |
Changing Computer Name
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Mar 2002
Status:
Offline
|
|
How do I change my computer name? More specifically, the name in the prompt when using terminal.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
System Preferences -> Sharing -> Computer Name
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status:
Offline
|
|
sudo hostname -s whatever
works too, but it wont persist reboots. the above solution is persistent.
|
|
signatures are a waste of bandwidth
especially ones with political tripe in them.
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status:
Offline
|
|
sudo pico /etc/hostconfig
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by gatorparrots:
sudo pico /etc/hostconfig
In Panther that is no longer the preferred way of doing it. The item in there:
HOSTNAME=-AUTOMATIC-
should remain as such to ensure that you can change the name for sharing and other purposes. Setting it in Sharing does NOT change the value in hostconfig, so they are not equivalent operations.
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status:
Offline
|
|
Originally posted by Arkham_c:
In Panther that is no longer the preferred way of doing it. The item in there:
HOSTNAME=-AUTOMATIC-
should remain as such to ensure that you can change the name for sharing and other purposes. Setting it in Sharing does NOT change the value in hostconfig, so they are not equivalent operations.
So does anyone know where is this set? Say you want to change it from the command line like if you were logged in via ssh, how would we go about doing that?
|
"In Nomine Patris, Et Fili, Et Spiritus Sancti"
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Mar 2002
Location: Canberra, Australia
Status:
Offline
|
|
I know that one way you can change the hostname/computer name from the command line/ssh under 10.3 is:
sudo scutil --set LocalHostName desiredhostname
sudo scutil --set ComputerName desiredcomputername
similarly, you can retrieve the extisting values by:
scutil --get LocalHostName
scutil --get ComputerName
The value that is set for LocalHostName is what is displayed for the terminal prompt (value refered to by the Hostname=Automatic line in /etc/hostconfig)
As far as I know, the values specified in /etc/hostconfig are read at boot - you will propbably have to restart for the changes to take place - I could be wrong on this part. 
|
|
-- iBook Dual USB 600MHz/384MB/20G/DVD-CDRW
-- PowerBook G4 15" 1.25GHz/1GB/80GB/DVD-R
-- PowerMac 9600/300 300MHz/96MB/2+3+4GB/CD/ OS X 10.1.5, 9.2.1
-- iPod 15GB, 3rd Generation
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|