[K12OSN] Re: Help?: Windows to Samba bulk user add (cliebow at midmaine.com)

Matt Oquist moquist at majen.net
Wed Dec 21 18:03:40 UTC 2005

If I were you I'd just use rsync.  So what you want to do is go to the
Samba server and do something like this:
$ mkdir -p /mnt/tmp
$ mount -t smbfs -o username=windersuser,password=winderspw //windersserver/sharename /mnt/tmp

Then do something like this:
$ rsync -avu /mnt/tmp/ /home/

The "-u" in the rsync command ensures that even if you stop the rsync
command and have to start it again, it won't re-copy everything it's
already copied.

Then you'll have to
1. make sure that all your users exist on the Samba machine (either by writing a little script or using some other method, such as 'net rpc vampire')
2. make sure that the Linux users own their proper home directories
   Something like this should do the trick, *if* your users' home dirs
   have the same names as the usernames, and *if* your users are
   regular Linux users (in the /etc/passwd file instead of LDAP, for
   $ cd /home
   $ for hdir in `ls | sed 's/\///'`; do grep -q "^$hdir:" /etc/passwd && echo chowning $hdir && chown -R $hdir:users $hdir; done
3. make sure the Linux users have proper permissions to their home directories
   $ chmod -R u=rwX,g=,o= /home/*

This should get you on your way, though if you have different
usernames in Linux, or if the user's homedirs don't match their
usernames, you've got to do more complex things than these.


> From: cliebow at midmaine.com
> Subject: Re: [K12OSN] Help?: Windows to Samba bulk user add
> when i migrated users homedirs from a winblows to a samba fileserrver.all
> idid was make sure usernames matched...mounted the windows directory on to
> the samba machine and wrote a little script that moved My Documents oer
> for each user..Ill look for it tomorrow if you need it..the script is
> basically trivial..chuck
>  Hi all,
> >
> > I am trying to find a way to migrate 800 users file stores from
> > Windows 2k3 AD to Samba. Is there a way to move the data in users file
> > shares without having to create and move each user and  directory by
> > hand? I've seen some ldap tools that seem to do this but since I am
> > not using OpenLdap for authentication I am not sure if they would
> > work.
> >
> > TIA!
> >
> > John
Open Source Software Engineering Consultant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/k12osn/attachments/20051221/18caeb6a/attachment.sig>

More information about the K12OSN mailing list