I changed my MacBook Pro's hostname, but the login screen still shows the old hostname. Please could anyone help me to change this.

link|improve this question

20% accept rate
feedback

migrated from serverfault.com Jul 27 '10 at 12:54

This question came from our site for system administrators and desktop support professionals.

3 Answers

Take a look at Mac OS X Hostname Determination, in short adjust your HOSTNAME in /etc/hostconfig and not only in Sharing-Preferences.

(Actually, there are 2 places in sharing-preferences where you may change your hostname, first the big textbox when you open up the preferencepane and second after you click on edit.)

link|improve this answer
feedback

On 10.4 and 10.5 check the file /Library/Preferences/SystemConfiguration/preferences.plist on the bottom there are these lines:

        <key>HostNames</key>
        <dict>
            <key>LocalHostName</key>
            <string>*********</string>
        </dict>
    </dict>
    <key>System</key>
    <dict>
        <key>ComputerName</key>
        <string>***********</string>
        <key>ComputerNameEncoding</key>
        <integer>0</integer>
link|improve this answer
feedback

Did you restart the ssh server?

From a shell:

/etc/init.d/sshd restart
link|improve this answer
no, how to do that? – Karthik Jul 27 '10 at 10:22
I added the command in my response. – lg. Jul 27 '10 at 11:25
3  
OSX doesn't have /etc/init.d, all daemons are controlled through launchctl, the cli tool for launchd. Anyway, you can restart the ssh server through the GUI in System Preferences -> Sharing and then switch off remote login and switch it on again. This doesn't help changing the hostname though. – Jasper Jul 27 '10 at 12:06
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.