SSH: The Secure Shell (The Definitive Guide)
Barrett, Silverman, & Byrnes / O’Reilly

SSH Frequently Asked Questions

How do I get trusted-host (SSH-2 "hostbased", SSH-1 "RhostsRSA") authentication working?

Note that OpenSSH support for hostbased authentication in protocol 2 did not appear until version 2.9.

In trusted-host authentication, the SSH server does not directly authenticate a user based on something he knows or has (e.g. password or private key). Rather, it authenticates the client host, and then trusts that host to say who the user is (i.e., which client-side account he has already been authenticated to use). It then consults server-side configuration (e.g. /etc/shosts.equiv or ~/.shosts) to determine which account names on the client host are allowed access to which server accounts. So, this mechanism actually delegates responsibility for user authentication to the client host — and hence, compromise of a client means immediate transitive compromise of corresponding accounts on the server.

Since the client software is being specially trusted, for Unix implementations this generally means that some part of it needs to be setuid/setgid, in order to read the client's private host key. Most installations make the host private key readable only by root, and thus the software must be setuid root. However, this is not an requirement; a configuration could also work using a non-privileged user or group to gate access to the private key. This would actually be preferable, since there is no need to give the SSH client software any of root's special privileges.

An exception to this occurs in some older SSH software. The original SSH1 trusted-host method ("RhostsRSA") mimicked its namesake rhosts method in using a "trusted source port:" it required the source TCP port of the client's network connection to be in the range [1,1023]. By convention, only privileged Unix processes are allowed to bind these ports, and so this was used as a test of the trustworthiness of the client software. In SSH, however, this test is both unnecessary and harmful: access to the client host key is a sufficient (and superior) way to verify client trust, and requiring root privilege is a danger best avoided if possible. The trusted source port requirement was never present in SSH2, and was dropped in OpenSSH with version 2.5.1. It is still present in SSH1, since that code now receives only bugfix maintenance.

Common Problems