From owner-freebsd-isp@FreeBSD.ORG Wed Jul 7 12:53:17 2004 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29E5616A4CE for ; Wed, 7 Jul 2004 12:53:17 +0000 (GMT) Received: from otter3.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id A0F3D43D3F for ; Wed, 7 Jul 2004 12:53:16 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by otter3.centtech.com (8.12.3/8.12.3) with ESMTP id i67CrFE8032156; Wed, 7 Jul 2004 07:53:15 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <40EBF237.9000007@centtech.com> Date: Wed, 07 Jul 2004 07:53:11 -0500 From: Eric Anderson User-Agent: Mozilla Thunderbird 0.7 (X11/20040624) X-Accept-Language: en-us, en MIME-Version: 1.0 To: isak@isak.is References: <20040707113030.M34913@isak.is> In-Reply-To: <20040707113030.M34913@isak.is> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: freebsd-isp@freebsd.org Subject: Re: samba on freebsd compared to linux X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2004 12:53:17 -0000 Ísak Ben. wrote: > add user script = /usr/sbin/useradd -m %u > 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 /dev/null %u > useradd -g machine -c whatever -d /dev/null -s /bin/false -n machinename$ > >We who have setup samba servers know these lines well... > >But my question is: Has anyone done this with freebsd tools like pw and so on ? > >Im setting up a server for 20-30 clients and i think ldap is a bit of an overkill for that.....maybe someone has >done this already without using ldap and can share with the rest of us ? ;) > > Here's my add machine script, which can be tweaked to do most of the other stuff: in smb.conf: add machine script = /usr/local/etc/mtrust %u ---> /usr/local/etc/mtrust script begin <--- #!/bin/csh -f set MNAME = $1 set MGID = 10000 set MUID = `cat /usr/local/etc/muid` /usr/sbin/pw useradd ${MNAME} -q -g 10000 -u $MUID -c ${MNAME} -d /dev/null -s /usr/bin/false echo "/usr/sbin/pw useradd ${MNAME} -q -g 10000 -u $MUID -c ${MNAME} -d /dev/null -s /usr/bin/false" >> /tmp/eric.log /usr/local/bin/smbpasswd -a -m ${MNAME} echo "/usr/local/bin/smbpasswd -a -m ${MNAME}" >> /tmp/eric.log @ MUID ++ echo $MUID > /usr/local/etc/muid ---> script end <--- There is one file I create, called "muid", which is the machine's starting user id. I start this at 10000, and it will increment up automatically as machines (or users, groups, whatever) are added. Hope it helps.. Eric -- ------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Talk sense to a fool and he calls you foolish. ------------------------------------------------------------------