Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Changing Computer Name

Changing Computer Name
Thread Tools
Fresh-Faced Recruit
Join Date: Mar 2002
Status: Offline
Reply With Quote
Jan 23, 2004, 06:57 AM
 
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
Reply With Quote
Jan 23, 2004, 09:39 AM
 
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
Reply With Quote
Jan 23, 2004, 10:39 AM
 
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
Reply With Quote
Jan 23, 2004, 05:58 PM
 
sudo pico /etc/hostconfig
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Jan 23, 2004, 07:20 PM
 
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
Reply With Quote
Apr 26, 2004, 11:48 AM
 
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
Reply With Quote
Apr 28, 2004, 08:26 PM
 
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
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:50 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2