AW: [Samba] [profiles] server seperate from PDC ?

Matthias Spork samba at matthiasspork.de
Fri Mar 12 20:34:11 GMT 2004


Hello Uli,

> > profiles with all permissions to the new server.
> Is this the way it works?
> I tried the other way round today: I smbmounted the old share on
> the new server and all profiles I could see were owned by root:wheel
> (which wouldn't work).
> Or do you use nis/nfs?

In your profile-directory you have two kinds of permissions:

1. Unix permissions for each file
2. User and group-profiles of ntuser.dat

You have to pay attention only to the first one:

If you have all profiles in one directory like
/home/max
/home/moritz
copy this profiles to the mounted directory
/mnt/newserver/max
/mnt/newserver/moritz

Yet you can use the following short PHP-shellscript to chmod and chown the
profiles on the new server.
(Any other kind of programming language should be able to work, too)


--------BEGINN-----------
#!/usr/bin/php -q
<?php

$path = "/samba/profiles/";

echo "\n";
$handle=opendir($path);
while($file = readdir($handle)) {
    if( $file != "." && $file != ".." ){
        echo $path . $file;
        exec("chmod 700 $file -R");
        exec("chgrp ntusers $file -R");
        exec("chown $file $file -R");
        echo "\n";
    }
}
echo "\n";
?>
--------END--------------

matze



More information about the samba mailing list