Changing the Default User Name for AFP Connections

When you use the Connect to Server command in the Finder to connect to an AFP server, the login panel populates your full user name by default. In Mac OS X version10.5 and later, you can customize this panel to present your short name, a custom name, or no user name at all.

IMPORTANT: These instructions involve using the defaults command to edit a property list (.plist) file and are intended for experienced Mac OS X administrators. Incorrect editing of this file can lead to unexpected Mac OS X behavior. Before following these instructions, make a backup copy of the /Library/Preferences/com.apple.NetworkAuthorization.plist file.

You can edit this file so that the Name field in the Connect to Server dialog is populated with one of the following:

Current user’s long name (default behavior)

Current user’s short name

A custom name

No name

NOTE: If you select the “Remember password in keychain” option in the Connect to Server dialog, the name stored in the Keychain entry overrides the setting in this preference file.

Use the defaults command in Terminal to change the default name to the following:

To set the current user’s short name:

$ defaults write /Library/Preferences/com.apple.NetworkAuthorization UseDefaultName -bool NO

$ defaults write /Library/Preferences/com.apple.NetworkAuthorization UseShortName -bool YES

To set a custom name:

$ defaults write /Library/Preferences/com.apple.NetworkAuthorization UseDefaultName -bool YES

$ defaults write /Library/Preferences/com.apple.NetworkAuthorization DefaultName “user”

Replace “user” with the desired custom name and enclose it in quotation marks.

To set no name:

$ defaults write /Library/Preferences/com.apple.NetworkAuthorization UseDefaultName -bool YES

$ defaults write /Library/Preferences/com.apple.NetworkAuthorization DefaultName “”

To set the current user’s long name (Default):

This is only necessary if you have made any of the changes listed above.

$ defaults write /Library/Preferences/com.apple.NetworkAuthorization UseDefaultName -bool NO

$ defaults write /Library/Preferences/com.apple.NetworkAuthorization UseShortName -bool NO

or

$ defaults delete /Library/Preferences/com.apple.NetworkAuthorization UseDefaultName

$ defaults delete /Library/Preferences/com.apple.NetworkAuthorization UseShortName