Hi to all,
I have Samba configured as domain member with winbind and kerberos, I can access
all share but I have some problem with the home directories because it ask me
for password.
This is my smb.conf
[global]
workgroup = domain
netbios name = Manufac
server string = Server di rete
comment = server di rete
encrypt passwords = true
realm = DOMAIN..LOCAL
password server = pdc01.domain.local
security = ADS
winbind enum users = yes
winbind enum groups = yes
winbind separator= +
idmap uid = 500-100000000
idmap gid = 500-100000000
template shell = /bin/true
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
ldap ssl = no
panic action = /usr/share/samba/panic-action %d
invalid users = root
template homedir = /home/%U
[homes]
comment = Home Directories
browseable = no
writable = yes
public = no
valid users = DOMAIN/%U
create mode = 0777
directory mode = 0777
I have the home directory created in /home/ with domain user right
Thank you in advance.
Bye
Massimo,
Perhaps removing the 'valid users' solves your problem. In theory it can
only display the homedir of the user connecting. The 'homes' share is
translated to the user name. Below if my current config that is working
for me. The preexec that I have is creating the homedir if it does not
exist (Perhaps that may be another possible cause of your error?).
Script is included. Make sure you change $path to your homedir location.
For quota uncomment and change the quota function for a given device.
Regards,
Ton
[homes]
comment = Home Directories
read only = No
browseable = No
root preexec = /etc/samba/homedir.pl %U
create mask = 0664
directory mask = 0775
homedir.pl:
#!/usr/bin/perl -w
use strict;
my $user = shift;
my $path = "<path to your homedir locations>";
my $logfile = "/var/log/samba/homedir.log";
if (! -d "$path/$user" && $user) {
if (my $uid = getpwnam($user)) {
if ((mkdir "$path/$user",0750) && (chown $uid,
-1,
"$path/$user")) {
open(LOG, ">>$logfile");
my $time = localtime;
print LOG "$time: Homedir $path/$user for
uid:$uid created.\n";
#Set default quota for mount points:
#quota($user,15000,"</dev/sda>");
close(LOG);
}
}
}
sub quota {
my $user = shift;
my $quota = shift;
my $mount = shift;
if (system("/usr/sbin/setquota -u $user 0 $quota 0 0 $mount")
=0)
{
my $time = localtime;
print LOG "$time: Updated quota settings for user $user on
$mount\n";
}
}
>Perhaps removing the 'valid users' solves your problem. In theory it can >only display the homedir of the user connecting. The 'homes' share is >translated to the user name. Below if my current config that is working >for me. The preexec that I have is creating the homedir if it does not >exist (Perhaps that may be another possible cause of your error?). >Script is included. Make sure you change $path to your homedir location. >For quota uncomment and change the quota function for a given device.Hi Ton, Thank you for the help. I tryed to set your configuration. It creates the home directories but I receive access denied, wathching into the log I found that it looking for username.dll file but I don't know the matter. Below the log ... Bye Massimo [2009/11/23 14:43:05, 0] param/loadparm.c:process_usershare_file(4611) process_usershare_file: stat of /var/lib/samba/usershares/massimo.dll failed. Permission denied [2009/11/23 14:43:07, 0] param/loadparm.c:process_usershare_file(4611) process_usershare_file: stat of /var/lib/samba/usershares/massimo.dll failed. No such file or directory [2009/11/23 14:43:07, 0] smbd/service.c:make_connection(1200) kdgp3fb (10.29.30.1) couldn't find service massimo.dll [2009/11/23 14:43:07, 0] smbd/service.c:set_current_service(184) chdir (/home/massimo) failed [2009/11/23 14:43:07, 0] param/loadparm.c:process_usershare_file(4611) process_usershare_file: stat of /var/lib/samba/usershares/massimo.dll failed. Permission denied [2009/11/23 14:43:09, 0] param/loadparm.c:process_usershare_file(4611) process_usershare_file: stat of /var/lib/samba/usershares/massimo.dll failed. No such file or directory [2009/11/23 14:43:09, 0] smbd/service.c:make_connection(1200) kdgp3fb (10.29.30.1) couldn't find service massimo.dll [2009/11/23 14:43:09, 0] smbd/service.c:set_current_service(184) chdir (/home/massimo) failed [2009/11/23 14:43:09, 0] smbd/service.c:set_current_service(184) chdir (/home/massimo) failed [2009/11/23 14:43:09, 0] smbd/service.c:set_current_service(184) chdir (/home/massimo) failed [2009/11/23 14:43:09, 0] smbd/service.c:set_current_service(184) chdir (/home/massimo) failed