J. Echter
2011-Mar-16 10:09 UTC
[Samba] Samba PDC adding new user, profile dir is not created
Hi, i have a Samba PDC (no LDAP) and added add user script to my config. I can create the user with no problems, login is possible but the /home/samba/profile/user dir is not created. Any hints on that? script commands i added: add user script = /usr/sbin/useradd -m '%u' -g ntusers -G ntusers -s /bin/false delete user script = /usr/sbin/userdel -r '%u' add group script = /usr/sbin/groupadd '%g' delete group script = /usr/sbin/groupdel '%g' add user to group script = /usr/sbin/usermod -G '%g' '%u' add machine script = /usr/sbin/useradd -s /bin/false -d /var/lib/nobody '%u' -g machines this is running on Ubuntu 10.04-LTS server greetings Juergen.
Marco Ciampa
2011-Mar-16 10:21 UTC
[Samba] Samba PDC adding new user, profile dir is not created
On Wed, Mar 16, 2011 at 11:09:59AM +0100, J. Echter wrote:> Hi, > > i have a Samba PDC (no LDAP) and added add user script to my config. > > I can create the user with no problems, login is possible but the > /home/samba/profile/user dir is not created. > > Any hints on that?IMHO you have to create it with a script. In that script you will create the user (with useradd) and then the profile dir... -- Marco Ciampa +--------------------+ | Linux User #78271 | | FSFE fellow #364 | +--------------------+
J. Echter
2011-Mar-16 10:32 UTC
[Samba] Samba PDC adding new user, profile dir is not created
Am 16.03.2011 11:21, schrieb Marco Ciampa:> On Wed, Mar 16, 2011 at 11:09:59AM +0100, J. Echter wrote: >> Hi, >> >> i have a Samba PDC (no LDAP) and added add user script to my config. >> >> I can create the user with no problems, login is possible but the >> /home/samba/profile/user dir is not created. >> >> Any hints on that? > IMHO you have to create it with a script. > In that script you will create the user (with useradd) and then the profile dir... >ok, seems i need to figure out how this has to be done... greetings.
Hi You must have something like this: in smb.conf^ [profiles] ..... root preexec = /usr/local/bin/mkprofile.sh %u %g .... mkprofile.sh: #!/bin/sh PROFILE=/data2/profiles/$1 if [ ! -e $PROFILE ]; then mkdir -pm700 $PROFILE chown $1:$2 $PROFILE fi Wed, 16 Mar 2011 11:09:59 +0100 ?????? ?? "J. Echter" <j.echter at elektro-mayer-echter.de>:> Hi, > > i have a Samba PDC (no LDAP) and added add user script to my config. > > I can create the user with no problems, login is possible but the > /home/samba/profile/user dir is not created. > > Any hints on that? > > script commands i added: > > add user script = /usr/sbin/useradd -m '%u' -g ntusers -G ntusers -s > /bin/false > delete user script = /usr/sbin/userdel -r '%u' > add group script = /usr/sbin/groupadd '%g' > delete group script = /usr/sbin/groupdel '%g' > add user to group script = /usr/sbin/usermod -G '%g' '%u' > add machine script = /usr/sbin/useradd -s /bin/false -d /var/lib/nobody > '%u' -g machines > > > this is running on Ubuntu 10.04-LTS server > > > greetings > > Juergen. > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/options/samba
Bruce Richardson
2011-Mar-16 10:50 UTC
[Samba] Samba PDC adding new user, profile dir is not created
On Wed, Mar 16, 2011 at 11:09:59AM +0100, J. Echter wrote:> Hi, > > i have a Samba PDC (no LDAP) and added add user script to my config. > > I can create the user with no problems, login is possible but the > /home/samba/profile/user dir is not created.It'll be created automatically when the user first logs in, if you have the right permissions on the profile share. It is possible to set the permissions/acls such that this doesn't allow users to read or interfere with each other's profiles. You only need to create it yourself if you want to preload it with some data. Is this what you need to do? -- Bruce Bitterly it mathinketh me, that I spent mine wholle lyf in the lists against the ignorant. -- Roger Bacon, "Doctor Mirabilis"
Bruce Richardson
2011-Mar-16 13:40 UTC
[Samba] Samba PDC adding new user, profile dir is not created
On Wed, Mar 16, 2011 at 11:21:42AM +0100, Marco Ciampa wrote:> > IMHO you have to create it with a script. > In that script you will create the user (with useradd) and then the profile dir...I think it is probably a bad idea to do this with a script unless you have some good reason to need it. The auto-creation of the directory shows you that profiles are working properly. -- Bruce I unfortunately do not know how to turn cheese into gold.
J. Echter
2011-Mar-16 16:47 UTC
[Samba] Samba PDC adding new user, profile dir is not created
Am 16.03.2011 17:21, schrieb TAKAHASHI Motonobu:> > - Created a user: > > # useradd -d /var/home/test01 test01 > # smbpasswd -a test01 > # pdbedit -v test01 > ... > Profile Path: \\lenny5\profiles\test01 > ... > > > - When I logon as test01 from Windows XP workstation which is already > joined to the "SAMBA" domain and logoff, profiles are created like: > > # ls -lR /var/lib/samba > total 4 > drwxr-xr-x 6 root root 4096 2011-03-15 20:48 shares > > /var/lib/samba/shares: > total 16 > drwxrwxrwx 6 root root 4096 2011-03-17 01:07 profiles > > /var/lib/samba/shares/profiles: > total 16 > drwx------ 13 test01 test01 4096 2011-03-17 01:08 test01 > > /var/lib/samba/shares/profiles/test01: > total 568 > drwx------ 3 test01 test01 4096 2010-10-11 01:10 Start Menu > drwx------ 2 test01 test01 4096 2010-10-11 01:10 Desktop > drwx------ 4 test01 test01 4096 2011-03-17 01:08 Application Data > drwx------ 2 test01 test01 4096 2010-10-11 01:18 Cookies > drwx------ 3 test01 test01 4096 2011-03-17 01:08 Favorites > drwx------ 4 test01 test01 4096 2011-03-17 01:08 My Documents > drwx------ 2 test01 test01 4096 2010-10-11 01:10 NetHood > -rw------- 1 test01 test01 524288 2011-03-17 01:08 NTUSER.DAT > -rw------- 1 test01 test01 1024 2011-03-17 01:08 ntuser.dat.LOG > -rw------- 1 test01 test01 270 2011-03-17 01:08 ntuser.ini > ... > > --- > TAKAHASHI Motonobu<monyo at monyo.com>sorry again, something missing... i have to handle ringing telephones... i added a user like you did pdbedit -v bla Profile Path: \\pdc\profile\bla login as this user and logout again, no profile dir is created.
tms3 at tms3.com
2011-Mar-16 17:02 UTC
[Samba] Samba PDC adding new user, profile dir is not created
You should show us enough information for us to re-produce such as> >> >> all content of smb.conf and related settings: >> >> In my lab, profile dir is successfully created. My env is... >> >> - Debian lenny (hostname is "lenny5") + self-compiled Samba 3.5.6 >> - my smb.conf and shares >> >> --- >> [global] >> workgroup = SAMBA >> domain logons = yes >> add machine script = useradd %u >> map to guest = bad user >> >> logon path = \\lenny5\profiles\%U >> >> [homes] >> writeable = yes >> browseable = no >> >> [profiles] >> path = /var/lib/samba/shares/profiles >> guest ok = yes >> browseable = no >> create mask = 0600 >> directory mask = 0700 >> writeable = yes >> --- >> >> # ls -lR /var/lib/samba >> /var/lib/samba/: >> total 4 >> drwxr-xr-x 6 root root 4096 2011-03-15 20:48 shares >> >> /var/lib/samba/shares: >> total 16 >> drwxrwxrwx 6 root root 4096 2011-03-17 01:07 profiles >> >> - Created a user: >> >> # useradd -d /var/home/test01 test01 >> # smbpasswd -a test01 >> # pdbedit -v test01 >> ... >> Profile Path: \\lenny5\profiles\test01 >> ... >> >> >> - When I logon as test01 from Windows XP workstation which is already >> joined to the "SAMBA" domain and logoff, profiles are created >> like: >> >> # ls -lR /var/lib/samba >> total 4 >> drwxr-xr-x 6 root root 4096 2011-03-15 20:48 shares >> >> /var/lib/samba/shares: >> total 16 >> drwxrwxrwx 6 root root 4096 2011-03-17 01:07 profiles >> >> /var/lib/samba/shares/profiles: >> total 16 >> drwx------ 13 test01 test01 4096 2011-03-17 01:08 test01 >> >> /var/lib/samba/shares/profiles/test01: >> total 568 >> drwx------ 3 test01 test01 4096 2010-10-11 01:10 Start Menu >> drwx------ 2 test01 test01 4096 2010-10-11 01:10 Desktop >> drwx------ 4 test01 test01 4096 2011-03-17 01:08 Application Data >> drwx------ 2 test01 test01 4096 2010-10-11 01:18 Cookies >> drwx------ 3 test01 test01 4096 2011-03-17 01:08 Favorites >> drwx------ 4 test01 test01 4096 2011-03-17 01:08 My Documents >> drwx------ 2 test01 test01 4096 2010-10-11 01:10 NetHood >> -rw------- 1 test01 test01 524288 2011-03-17 01:08 NTUSER.DAT >> -rw------- 1 test01 test01 1024 2011-03-17 01:08 ntuser.dat.LOG >> -rw------- 1 test01 test01 270 2011-03-17 01:08 ntuser.ini >> ... >> >> --- >> TAKAHASHI Motonobu<monyo at monyo.com> > smb.conf > > [global] > printing = bsd > netbios name = PDC > server string = PDC (%h) > workgroup = workgroup > interfaces = eth0,lo > security = user > encrypt passwords = true > passdb backend = tdbsam > obey pam restrictions = yes > unix password sync = yes > passwd program = /usr/bin/passwd %u > passwd chat = *Enter\snew\sUNIX\spassword:* %n\n > *Retype\snew\sUNIX\spassword:* %n\n . > local master = yes > preferred master = yes > os level = 200 > domain master = yes > domain logons = yes > add user script = /usr/sbin/useradd -m '%u' -g ntusers -G > ntusers -s > /bin/false > delete user script = /usr/sbin/userdel -r '%u' > add group script = /usr/sbin/groupadd '%g' > delete group script = /usr/sbin/groupdel '%g' > delete group script = /usr/sbin/groupdel '%g' > add user to group script = /usr/sbin/usermod -G '%g' '%u' > add machine script = /usr/sbin/useradd -s /bin/false -d > /var/lib/nobody '%u' -g machines > logon path = \\%L\profile\%U > logon drive = h: > logon script = %U.bat > profile acls = yes > hide files = /desktop.ini/ntuser.ini/NTUSER.*/Thumbs.db/ > wins support = no > log file = /var/log/samba/log.%m > max log size = 1000 > syslog = 0 > log level = 12 > panic action = /usr/share/samba/panic-action %d > use sendfile = yesWhere is your profile path?
J. Echter
2011-Mar-17 21:47 UTC
[Samba] Samba PDC adding new user, profile dir is not created
Am 16.03.2011 18:00, schrieb TAKAHASHI Motonobu:> From: "J. Echter" <j.echter at elektro-mayer-echter.de> > Date: Wed, 16 Mar 2011 17:34:35 +0100 > >>> You should show us enough information for us to re-produce such as >>> all content of smb.conf and related settings: >>> >>> In my lab, profile dir is successfully created. My env is... > (snip) > >> smb.conf > (snip) > >> ls -lR /home/samba/profile > (snip) > > At first you had better try a simple settings like me. > > To look at your smb.conf, I tried with the smb.conf below: > > ----- > [global] > workgroup = SAMBA > domain logons = yes > add machine script = useradd %u > map to guest = bad user > > logon path = \\%L\profiles\%U > hide files = /desktop.ini/ntuser.ini/NTUSER.*/Thumbs.db/ > > [homes] > writeable = yes > browseable = no > > [profiles] > path = /var/lib/samba/shares/profiles > guest ok = yes > browseable = no > create mask = 0600 > directory mask = 0700 > writeable = yes > profile acls = yes > ----- > > and although still my user can create profile dirs and files... > > --- > TAKAHASHI Motonobu <monyo at monyo.com> > > > > >Hi, i have reduced my smb.conf a bit :) now it works. is there any option you would recommend to set for an PDC? Greetings and many many thanks for your hints. juergen