Mac OS X 10.3 or later: Can‘t log into AFP servers using SSH connection

When you try to make a secure AFP connection, you may receive this alert message:

"Cannot make a secure connection to "<Server>"

Secure connection failed. Please contact your server administrator. To connect with reduced security, click Continue.

Solution

In the Terminal, execute this command:

ssh username@hostname

If the response is:

ssh: connect to host hostname port 22: Operation timed out

... then SSH is most likely not enabled on the server, or the server is in sleep mode.

If the response is:

The authenticity of host 'hostname (xxx.xxx.xxx.xxx)' can't be established. RSA key fingerprint is fa:71:73:98:bd:05:bb:7c:07:b6:55:8f:2f:1b:b0:da. Are you sure you want to continue connecting (yes/no)?

... then the host key is not known. Just type yes, and continue.

If the response is:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
7a:43:4e:40:b2:e0:be:f8:00:99:38:b8:dc:72:e5:02.
Please contact your system administrator.
Add correct host key in .ssh/known_hosts to get rid of this message.
Offending key in .ssh/known_hosts:1
RSA host key for hostname has changed and you have requested strict checking.
Host key verification failed.

... then the host key does not match the one previously saved. You may want to edit your known_hosts file. But be sure that the server really has changed its key (most common during reinstallation/upgrading).

To learn more, execute

man ssh
in Terminal.

Published Date: Feb 20, 2012