Hi there, I have following homes section on my smb.conf file. [homes] comment = Home Directories browseable = no read only = no valid users = %S guest ok = no path = /home/remote/%U root preexec = /usr/local/sbin/mkhomdironfly.sh %U script to make home directory i.e mkhomdironfly.sh if [ ! -e /home/remote/$1 ]; then mkdir /home/remote/$1 cp /etc/skel/* /home/remote/$1 chown -R $1 /home/remote/$1 chgrp -R "domain users" /home/remote/$1 chmod -R 700 /home/remote/$1 fi exit 0 ~ I was able to login but the home directory is not created. And it does not show any sort of errors in the log file. i have also created /home/remote with drwsr-x--- permission and "domain users" as group. drwsr-x--- 3 root domain users 4096 May 30 09:41 remote But still home directory is not created. Thank You. gsumk
On Wed, 30 May 2018 14:56:53 +0000 Suman Koirala via samba <samba at lists.samba.org> wrote:> > > > > Hi there, > > > I have following homes section on my smb.conf file. > > > > [homes] > comment = Home Directories > browseable = no > read only = no > valid users = %S > guest ok = no > path = /home/remote/%U > root preexec = /usr/local/sbin/mkhomdironfly.sh %U > > > script to make home directory i.e mkhomdironfly.sh > > > if [ ! -e /home/remote/$1 ]; then > mkdir /home/remote/$1 > cp /etc/skel/* /home/remote/$1 > chown -R $1 /home/remote/$1 > chgrp -R "domain users" /home/remote/$1 > chmod -R 700 /home/remote/$1 > fi > exit 0 > ~ > > > I was able to login but the home directory is not created. And it > does not show any sort of errors in the log file. > > > i have also created /home/remote with drwsr-x--- permission and > "domain users" as group. > > drwsr-x--- 3 root domain users 4096 May 30 09:41 remote > > > But still home directory is not created. > > Thank You. > > > gsumkAny chance you can post the global part of the smb.conf ? What OS ? What Samba version ? Rowland
On Thu, 31 May 2018 08:25:52 +0000 Suman Koirala <koiralasu at mnstate.edu> wrote:> I am using ubuntu 18.04 > and samba Version 4.7.6-Ubuntu > > > I am able to login using domain credentials but not being able to get > the script executed to make the home directory. >I am very surprised that it works, you do not use the winbind ldap backend on a Unix domain member. Try this smb.conf: [global] ## Browsing/Identification ### # set to act as domain member in an ADS realm realm = EXAMPLE.NET workgroup = DOMAIN security = ads #### Debugging/Accounting #### # use a separate log file for each machine that connects log file = /var/log/samba/log.%m # Cap the size of the individual log files (in KiB). max log size = 1000 # nothing is logged through syslog, but sent to /var/log/samba/log.{smbd,nmbd} instead syslog = 0 # Do something sensible when Samba crashes: mail the admin a backtrace panic action = /usr/share/samba/panic-action %d # Winbind configuration idmap config * : backend = tdb idmap config * : range = 3000-7999 # seeing as you were trying to get data from ldap, I think you must have # uidNumber & gidNumber attributes in AD # If so use the next four lines. idmap config DOMAIN : backend = ad idmap config DOMAIN : unix_nss_info = yes idmap config DOMAIN : schema_mode = rfc2307 idmap config DOMAIN : range = 10000-999999 # If you haven't got uidNumber & gidNumber attributes in AD, comment the # four lines above and uncomment the next two lines. #idmap config DOMAIN : backend = rid #idmap config DOMAIN : range = 10000-999999 winbind separator = + # this option will remove 'DOMAIN\' from user & group names # but must not be used if multiple domains are used winbind use default domain = yes template homedir = /home/remote/%U template shell = /bin/bash domain master = no local master = no preferred master = no usershare allow guests = no Please read the comments around the 'idmap config' lines. Do not bother with a script to create the homedirs, let PAM do it for you. Add this line to the end of /etc/pam.d/common-session session required pam_mkhomedir.so skel=/etc/skel/ umask=0022 Rowland
On Fri, 1 Jun 2018 15:19:11 +0000 Suman Koirala <koiralasu at mnstate.edu> wrote:> Thank You Rowland. I was able to create home directory using > pam_mkhomedir.so module. now I have a different problem. For my > server side we create a new home directory and we have our client > machines as well which has to mount from the server.Can you explain this a bit better ? I think you mean you have created a share and want to mount this on clients, but I could be way off.> > i can login to client but I am not able get the home directory > mounted on it. Thank You.If you want to mount the clients homedir from the server, we need to know what the clients OS is. Rowland
On Fri, 1 Jun 2018 18:14:30 +0000 Suman Koirala <koiralasu at mnstate.edu> wrote:> We are using ubuntu 18.04 as our client as well. When user login to > out server it creates home dir for them. Then we have client > machines. When user loginin to that machine that share should mount > on that machine. Thank You > > gsumk > >So, you are looking for something like windows profiles ? There are several ways of doing what you want. investigate NFS, autofs, pam-script, pam-mount, cifs-mount etc and make your choice. Rowland
On Tue, 5 Jun 2018 14:36:10 +0000 Suman Koirala <koiralasu at mnstate.edu> wrote:> Thank You Rowland for you help. I was trying to user cifs mount but I > am getting permission issues. I have no idea where that issu is > coming from. mount.cifs kernel mount options: > ip=x.x.x.x,unc=\\servername\username,user=root,prefixpath=remote/username,pass=******** > mount error(13): Permission denied Refer to the mount.cifs(8) manual > page (e.g. man mount.cifs) > > could you please give me some hint on them. > Thank You. > > gsumk >Have you read this ? https://wiki.samba.org/index.php/Mounting_samba_shares_from_a_unix_client Rowland