From 1848925af2ca2cbfaac2bf7de39b007c314a01f7 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 26 Oct 2004 08:48:42 +0000 Subject: configure sshd to use PAM when needed (sshd config file is modified, but i did not test more) --- perl-install/authentication.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/perl-install/authentication.pm b/perl-install/authentication.pm index 783fadac7..42ffd3b84 100644 --- a/perl-install/authentication.pm +++ b/perl-install/authentication.pm @@ -144,6 +144,8 @@ sub set { log::l("authentication::set $kind"); + sshd_config_UsePAM($kind ne 'local'); + if ($kind eq 'LDAP') { $in->do_pkgs->install(qw(openldap-clients nss_ldap pam_ldap autofs)); @@ -528,6 +530,18 @@ sub krb5_conf_update { } +sub sshd_config_UsePAM { + my ($UsePAM) = @_; + my $sshd = "$::prefix/etc/ssh/sshd_config"; + -e $sshd or return; + + my $val = "UsePAM " . bool2yesno($UsePAM); + substInFile { + $val = '' if s/^#?UsePAM.*/$val/; + $_ .= "$val\n" if eof && $val; + } $sshd; +} + sub query_srv_names { my ($domain) = @_; -- cgit v1.2.1