Learn how to configure an AFP (Apple File sharing Protocol) client to exclusively use OpenSSH as the connection method, instead of a clear connection. This is an advanced document for Mac OS X 10.3 and 10.4.
AFP includes a feature to use OpenSSH as the data transport mechanism. To prevent OpenSSH from using a clear connection, these three preferences must be set by editing a configuration file (com.apple.AppleShareClientCore):
afp_ssh_allow=1
Enables the feature and instructs the client to try OpenSSH if the server advertises it
afp_ssh_force=1
Instructs the client to use OpenSSH even if the server does not say it is available
afp_ssh_require=1
Causes the login attempt to fail if OpenSSH cannot automatically connect
Important: This settings must be made for each user account. They cannot be made globally.
Note: When these settings are in effect, if OpenSSH cannot establish a connection a "bad password" dialog box appears. The most common cause of OpenSSH failure is when the host key for the server is unknown or is changed. Administrators should distribute and maintain the /etc/ssh_known_hosts files in accordance with best security practices. Without the /etc/ssh_known_hosts file, users will need to manage their own known_hosts file and pre-establish the correct server key.
Editing the configuration file
There are two ways to do this:
Manually edit the file
Open the .GlobalPreferences.plist (which is in each user's ~/Library/Preferences/ folder) in a editor such as TextEdit. Change the three preferences described above.
Repeat this process for each additional account's .GlobalPreferences file.
Make a script
The following script can be saved into a file and run once for every account that will be using AFP over SSH. Follow these steps: