samba on freebsd compared to linux
Eric Anderson
anderson at centtech.com
Wed Jul 7 05:53:17 PDT 2004
Í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.
------------------------------------------------------------------
More information about the freebsd-isp
mailing list