summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-10-26 08:48:42 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-10-26 08:48:42 +0000
commit1848925af2ca2cbfaac2bf7de39b007c314a01f7 (patch)
tree3ef4517b7a7958d13225a7e0d023ebb38013190b
parent539e523fd320e8141bd9d0f2171508720816c6a2 (diff)
downloaddrakx-1848925af2ca2cbfaac2bf7de39b007c314a01f7.tar
drakx-1848925af2ca2cbfaac2bf7de39b007c314a01f7.tar.gz
drakx-1848925af2ca2cbfaac2bf7de39b007c314a01f7.tar.bz2
drakx-1848925af2ca2cbfaac2bf7de39b007c314a01f7.tar.xz
drakx-1848925af2ca2cbfaac2bf7de39b007c314a01f7.zip
configure sshd to use PAM when needed (sshd config file is modified, but i did not test more)
-rw-r--r--perl-install/authentication.pm14
1 files changed, 14 insertions, 0 deletions
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) = @_;