Samba Unix User adding script with Auto Group Selection
Copyright (C) 1999 Hiroshi MIURA All Rights Reserved.
This software may be used and distributed according to the terms of the GNU General Public License, Version 2 (GPL2). You can get it from Free Software Foundation, or contacting to me.
You can download from this server. The package include rshd16.zip and GetUserGroups.zip.
There are partner tool needed to use this tool.
selgrp_addusr is distributed hoping that it will be useful, but
WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.
The user must assume the entire risk of using the program.
THE AUTHOR SHALL NOT BE HELD LIABLE FOR ANY KIND OF DAMAGES OR
CLAIMS THAT DIRECTLY OR INDIRECTLY RESULT FROM USING THIS SOFTWARE.
selgrp_addusr [-h][-v] [-n NThostname] [-p DomainControler Hostname] [-d Domainname] Username
-h ...show this help
-v ...show version and License Terms.
-n NThostname ...set friend NT host
-p DChostname ...set Domain Controller(PDC,or BDC) Hostname
-d DomainName ...set Domain Name
Username ...who you want to query.
This tool aid make user with samba on the fly user adding feature.
Samba (Unix) side:
This script use/need SMB Group and UNIX group mapping file.
/etc/smbgroup is defind as followsNTGROUP1,NTGROUP3:unixgroup1
This means as follows:unixgroup1 is defined as such user belongs NTGROUP1 and NTGROUP3
unixgroup2 is defined as such user belogns NTGROUP2 and NTGROUP3
unixgroup3 is defined as same as NTGROUP4
unixgroup4 is defined as such user belongs NTGROUP4 and NTGROUP1
AND this file defined what is primary group.
early line in smbgroup file is strong on Primary group selection.
for example, UserA is belongs unixgroup1 and unixgroup3, UserA's primary
group is unixgroup1.
Edit your smb.conf file.
security = domain
security = server
password server = DomainController
add user script = /usr/bin/selgrp_usradd -n NThost -p DomainController %u
map to guest = Bad User
Windows NT side:
You must install RSHD remote shell daemon to Windows NT machine.
There are some imprementations now. But, this is checked with
please read install instructions include archive.
for your convenience, I bundled it.
You need to make c:\winnt\.rhosts file (or another location)
on Windows NT machine to allow execute commands from samba machine.
AND you need installing "GetUserGroups.exe" to Windows NT machine's
path. <WINDIR>\ is recommneds. This may be bandled with this tool.
Change some Defaults of Tool
You have to edit scripts defaults.
$defaultNTPC="10.12.27.172"; PC installed rshd and GetUserGroups
$defaultDC="terminator4"; Domain Controller (PDC or BDC)
$defaultDOMAIN="FANTASY"; Domain Name
# if you use "showgrps.exe" in NT4 Resouce Kit,
# you must set $UseShowGrps to 1.
$rsh="/usr/bin/rsh"; RSH command's path
$grpfile="/etc/smbgroup"; /etc/smbgroup file localtion.
# use add command line options
$useradd="/usr/sbin/useradd -p $userpass -d $userhome -s $usershell ";
and now you can restart samba.