LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Samba & Windows

[ILUG] Samba & Windows

Hunt, Bryan B.Hunt at emuse-tech.com
Wed Feb 27 10:15:28 GMT 2002


you could add a line like this to the smb.conf file 

add user script = /usr/sbin/smb_useradd.sh %u

cut=
#!/bin/sh

# SOME GLOBAL DEFINITIONS
ADMIN="b.hunt at emuse.ie"
SUBJECT="SAMBA $HOSTNAME Strange username has been denied"

function AddTheUser {

CLEAN_NAME=`echo $1 |  sed -e "s/[^0-9a-zA-Z_-]//g" | egrep -iv "root"`
OLD_NAME=$1

if [ "$CLEAN_NAME" != "$OLD_NAME" ]
  then  echo "Bogus Name $OLD_NAME " | mail "$ADMIN" -s "$SUBJECT";
else
  test=`/usr/sbin/useradd $CLEAN_NAME -g devusers  2>&1` ||  echo "Failed
user cre
ation $test" | mail $ADMIN -s "$SUBJECT";
fi
}

AddTheUser $1
=cut

I just knocked this together when I was messing about one time. 
You could also install pam_smb which was written by Dave Arlie who is on
this
list. How that would work is that if someone wanted an account on the linux
box
and they had an account on the pdc windows nt server. All they would have to

do is connect once to the linux box through their network neighborhood, this
would 
create their account, they could then ssh or whatever into the linux box 
(depending on what login stuff you had set up to work with pam_smb). 
Hey presto you can leave it to the NT admin to do all the user creation
stuff.

--B

PS: I haven't used this on a production machine.





-----Original Message-----
From: Mark Finlay [mailto:linuxexpert at eircom.net]
Sent: 26 February 2002 20:51
To: tfmackey at iol.ie
Cc: ilug at linux.ie
Subject: Re: [ILUG] Samba & Windows


On Tue, 2002-02-26 at 19:25, Tom Mackey wrote:
> Hi,
> At work, a Linux machine with Samba is on a network with a few hundred 
> Windows machines. Is there any simple way of adding the existing users to
the 
> Linux box or will all of them have to be individually added first as Linux

> users and then as Samba users?  I have joined the Linux Machine to the NT 
> domain and it is visable in "Network Neighbourhood" and the few users that

> have been added to Linux and Samba can access their home directories.
> Tom Mackey
> 
You can set samba to auto sync its users with the unix users - that would
make it a bit easier.

I'm sure a bash script could take alot of the work out of it.

Mark
 



-- 
Irish Linux Users' Group: ilug at linux.ie
http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
List maintainer: listmaster at linux.ie




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell