[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Samba Winbind create home directories change "domain users" group

Posted on 2009-12-17
Medium Priority
Last Modified: 2013-12-09
I am using winbind and samba to authenticate linux logins to windows.  I am able to auto-create user home directories.  I want to change the group on the home directories to something other than "Domain Users"
Question by:rsissick
  • 2
  • 2
LVL 21

Accepted Solution

Daniel McAllister earned 2000 total points
ID: 26076228
Assuming you have left everything default, you'll need to force a chance in your new-user script.

The DEFAULT (I believe) is to run the script that comes with Samba
(something like /usr/local/samba/bin/add_user (which comes with the distro)....

I don't know if that script takes any variables, but you could make it use the default unix useradd in a manner such as this:
        add user script = /use/sbin/useradd -g OTHERGID -m -b <path to homes> -s /sbin/nologin %u

NOTE: This script may NOT be exactly the same as the default one! What it WILL do though is:
 - create a user home folder at <path to homes>/username
 - make the user by default belong to the group OTHERGID (instead of Domain Users)
 - NOT allow the new user to login to the Linux box (no shell account -- samba is still fine!)

I am not POSITIVE that this will make the new home folder belong to the group OTHERGID... but I think it will!

Good Luck


Author Comment

ID: 26082990
That sounds could, but I cant find /usr/local/samba/bin/ I dont have any such directory.
LVL 21

Expert Comment

by:Daniel McAllister
ID: 26085111
The location of your samba binaries depends on how you installed it. The path I gave would assume you BUILT your samba from source. It appears that you installed from a package (or RPM), in which case the executables would be elsewhere (probably /usr/sbin).

To find the executable for smbd, run:
  find / -type f -name smbd -print

To find the add_user script (possibly executable program -- not sure with the latest samba!), run:
  find / -type f -name add_user -print

Good Luck!


Author Comment

ID: 26087993
Thnks ill gv that a shot

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
As a financial services provider, your business is impacted by two of the strictest federal regulations on record: the Sarbanes-Oxley Act and the Gramm-Leach-Bliley Act. Correctly implementing faxing into your organization to provide secure, real-ti…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question