Samba Unix User adding script

Submitted by Hiroshi Miura on 火曜, 2006-12-26 20:20

Samba Unix User adding script with Auto Group Selection

Ver 1.10
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.

DOWNLOAD

You can download from this server. The package include rshd16.zip and GetUserGroups.zip.
There are partner tool needed to use this tool.

DOWNLOAD Version 1.10 (selgrp_usradd-1.10.tar.gz) 81,722 byte

DOWNLOAD Version 1.10 (not include rshd16.zip and GetUserGroups.zip) 4,160 byte

Disclaimer

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.

Usage

 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.

 


Description

This tool aid make user with samba on the fly user adding feature.
 

Installation

Samba (Unix) side:

 

 This script use/need SMB Group and UNIX group mapping file.

 
  /etc/smbgroup is defind as follows
      NTGROUP1,NTGROUP3:unixgroup1
      NTGROUP2,NTGROUP3:unixgroup2
      NTGROUP4:unixgroup3
      NTGROUP4,NTGROUP1:unixgroup4


 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.

  eg.


  GG_SALES,GG_Proper:sales
  GG_SALES,GG_Partner:saleasst
  GG_ENGINEER:engineer
  GG_ENGINEER,GG_Partner:sesmember
  GG_MANAGER:manager

 Edit your smb.conf file.

 


security = domain
 or
   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
  only bellow.

    http://home.us.net/~silviu/rshd/rshd16.zip

  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.

# 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.
$UseShowGrps=0;

# paths
$rsh="/usr/bin/rsh";          RSH command's path
$grpfile="/etc/smbgroup";     /etc/smbgroup file localtion.
$userpass="'*';
$userhome="/home/$u";
$userhsell="/bin/false";

# use add command line options
$useradd="/usr/sbin/useradd -p $userpass -d $userhome -s $usershell ";

 


 and now you can restart samba.

添付サイズ
selgrp_usradd-1.10.tar.gz4.06 KB
selgrp_usradd-1.10wp.tar.gz79.32 KB
© 2010 Your Name. m