Doug White <[EMAIL PROTECTED]> writes:

> On Sat, 26 Feb 2000, Kris Kennaway wrote:
> 
> > On 26 Feb 2000, Bjoern Groenvall wrote:
> > 
> > > Right, the code does not lie (if ssh is setuid root). But, if the host
> > > key has not yet been created, then no host can have the public key and
> > > thus rsa-rhosts authentication won't work anyways. It is not required
> > > to run ssh-keygen to make ssh work, Sshd still requires the host key
> > > to operate.
> > 
> > I don't follow you - if no host key is generated, then you can't ever use
> > the RSA-rhosts authentication mechanism to log into another server until
> > you do. Thus part of ssh's functionality is broken until you generate that
> > key, so we do it for you the first time you boot.
> 
> I was under the impression that host keys are exchanged before the
> authentication type is selected, so a) the identity of the remote is
> compared to known_hosts and reacted to accordingly, and b) the remainder
> of the session is encrypted no matter what auth type (so, i.e., the
> password is encrypted if RSA keys are not used).

The server host key is used as part of the key material
negotiation. However, only the *server* host key is used, the client
end host key is never used. Just turn of the suid bit from ssh and
give it a try (or even mv /etc/ssh_host_key).

After the initial handshake it is time for authentication. If
RSA-rhost authentication is used then the ssh client uses the private
part of the client key. At the server end, the server looks up the
public part of the client host key and uses that to verify
authenticity. If the server can't find the client public key, then
access is denied.

So lets assume that the client don't have a host key but that it is
created during boot. Then there can be no host that knows the
corresponding public key. Now the client tries to use RSA-rhost
authentication, when the server attempts to verify authenticity it
will fail to lookup the key (remember that it was created on the
client perhaps moments ago). For RSA-rhost authentication to work the
public keys must first be shipped around among the hosts, only then
can RSA-rhost authentication operate.

> I'm thinking of the old/stock sshd, not OpenSSH, but I'm not aware of that
> big a change.

I don't think there has been any radical changes with respect to
this. There might be some extra knobs in OpenSSH to control wether the
server will accept public keys from $HOME/.ssh/known_hosts files or
only from /etc/ssh_known_hosts.

/Björn

-- 
  _     _                                               ,_______________.  
Bjorn Gronvall (Björn Grönvall)                        /_______________/|     
Swedish Institute of Computer Science                  |               ||
PO Box 1263, S-164 29 Kista, Sweden                    | Schroedingers ||
Email: [EMAIL PROTECTED], Phone +46 -8 633 15 25              |      Cat      |/
Cellular +46 -70 768 06 35, Fax +46 -8 751 72 30       `---------------' 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to