On Jul 5, 2006, at 2:01 PM, rross wrote:
> Hi .. I would like to only allow ssh login through public key
> access (OSX 10.4.7), but all the hints I found was to set
> "PasswordAuthentication no" and also "UsePAM no". I would think it
> would be a lot safer to continue to use PAM, but, instead, to
> modify /etc/pam.d/sshd to disallow login passwords. Do I need to be
> concerned if I disable "UsePAM"? Does anyone have hints on the PAM
> modification to disallow passwords?
My inclination would be to add the line:
PasswordAuthentication no
to /etc/sshd_config. On 10.4.7 client, UsePAM is 'no' by default; I
don't know if it's different on 10.4.7 server.
(There may be a more Mac-like way of editing those files; I'm relying
on my Unix-fu here.)
sshd supports several different means of authentication: the
relevant ones here are password, PAM, and key. By default, PAM is
disabled, and keys are preferred to passwords. If you disable
password authentication, you're then limited to keys, which is what
you want. If you don't *also* disable PAM authentication (or if you
don't leave it disabled) for sshd, you're opening yourself up to PAM
considering a password as valid authentication, which is not what you
want. Or you're in the situation where you're enabling PAM
authentication, but then telling it to not accept any authentication
as valid so that the only valid form of authentication is to use ssh
keys - you might as well just leave it off. (Or turn it off.)
Not using PAM authentication for sshd doesn't affect the use of PAM
authentication elsewhere, of course. If another component of your
system uses PAM, saying "UsePAM no" in /etc/sshd_config will not
affect that other component.
Charlton
--
Charlton Wilbur
cwilbur

chromatico.net