From 40f38560d454ffa66b24343f76313c53e933d82d Mon Sep 17 00:00:00 2001 From: Wouter den Breejen Date: Sun, 29 Mar 2009 21:43:40 +0000 Subject: [PATCH] Allow samba to use PAM (needs cleartext passwords for now) svn path=/nixos/trunk/; revision=14768 --- etc/default.nix | 1 + etc/pam.d/samba | 4 ++++ upstart-jobs/samba.nix | 11 ++++++++--- upstart-jobs/smb.conf | 26 ++++++++++++++++++++++---- 4 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 etc/pam.d/samba diff --git a/etc/default.nix b/etc/default.nix index 7c4d4af8c2c..b9411117971 100644 --- a/etc/default.nix +++ b/etc/default.nix @@ -249,6 +249,7 @@ import ../helpers/make-etc.nix { "useradd" "chsh" "xlock" + "samba" "kde" "cups" "ftp" diff --git a/etc/pam.d/samba b/etc/pam.d/samba new file mode 100644 index 00000000000..50f3cc5ce60 --- /dev/null +++ b/etc/pam.d/samba @@ -0,0 +1,4 @@ +auth include common +account include common +password include common +session include common diff --git a/upstart-jobs/samba.nix b/upstart-jobs/samba.nix index b1371c6f0f5..e5d4edd45a2 100644 --- a/upstart-jobs/samba.nix +++ b/upstart-jobs/samba.nix @@ -5,7 +5,12 @@ let user = "smbguest"; group = "smbguest"; - smbConfig = ./smb.conf ; + #smbConfig = ./smb.conf ; + + smbConfig = pkgs.substituteAll { + src = ./smb.conf; + inherit samba; + }; in @@ -45,13 +50,13 @@ start script ${samba}/sbin/nmbd -D -s ${smbConfig} & ${samba}/sbin/smbd -D -s ${smbConfig} & - ${samba}/sbin/winbindd -B -s ${smbConfig} & + ${samba}/sbin/winbindd -s ${smbConfig} & ln -fs ${smbConfig} /var/samba/config end script -respawn ${samba}/sbin/nmbd -D -s ${smbConfig} &; ${samba}/sbin/smbd -D -s ${smbConfig} &; ${samba}/sbin/winbindd -B & +respawn ${samba}/sbin/nmbd -D -s ${smbConfig} &; ${samba}/sbin/smbd -D -s ${smbConfig} &; ${samba}/sbin/winbindd & "; diff --git a/upstart-jobs/smb.conf b/upstart-jobs/smb.conf index d8e9e5797f8..889f3c628ee 100644 --- a/upstart-jobs/smb.conf +++ b/upstart-jobs/smb.conf @@ -1,9 +1,23 @@ [global] workgroup = Users - security = share server string = %h comment = Samba - local master = no + log file = /var/log/samba/log.%m + log level = 10 + max log size = 50000 + security = user + + #must be set to 'no' to use PAM + encrypt passwords = No + client plaintext auth = yes + client lanman auth = Yes + dns proxy = no + invalid users = root + passdb backend = tdbsam + passwd program = /usr/bin/passwd %u + +# encrypt passwords = yes +# smb passwd file = @samba@/private/smbpasswd #[default] # path = /home/smbd @@ -11,7 +25,11 @@ # guest ok = yes [raidbackup] - path = /home/raidbackup + path = /home/raidbackup/files read only = no guest ok = no - + available = yes + browseable = yes + public = yes + valid users = raidbackup + comment = Raid backup Files