in reply to How do I make two users have the same privileges?

Where's the perl question??? ;)

But here you got, `man smb.conf` and look for these - especially for: "force user", "force group".

o force create mode

o force directory mode

o force directory security mode

o force group

o force security mode

o force user

-- Daniellek

Replies are listed 'Best First'.
Re: Re: How do I make two users have the same privileges?
by Reaped: Answer: Vroom testing some more (Initiate) on Dec 15, 2000 at 21:01 UTC
    Sorry about the non-perl question, but thanks for the advice. Actually, this came up as the result of running a perl script that creates files owned by apache, and then my wanting to edit those files under Samba, if that counts ....

    Anyway, I tried almost everything here. I made a smbusers file which sets apache = my samba user and added the line:

    username map = /usr/local/etc/smbusers

    to the global parameters of smb.conf.

    I set the umask for apache and the samba user to 002. I changed the setgidbit on the document root directory for apache where the script is creating the directories that my samba user can't modify. I wasn't sure how to make sure that Samba was a member of the apache group except to make sure that the windows user accessing the box via Samba is. It is.

    Finally, in the smb.conf file, I added the parameters force user = apache and force group = apache, since the user and group owners of the files created by the script are apache and apache respectively.

    As root, I did a killall -HUP init and I waited the requisite minute for samba to reinitialize from the conf file just to be sure.

    I can read the files created by the script via my windows share, but I still can't save modifications to them.

    I do appreciate any additional suggestions anyone may have, especially given that this is only loosely related (for me) to Perl.

      I don't believe a killall -HUP init will do anything at all to Samba. All that does is tell init to re-read /etc/inittab and make the appropriate adjustments. You probably want to HUP smbd.

      In addition, make sure that the files are writable by the group. Actually, if you're forcing Samba and Apache to run as the same user, I can't imagine any reason why it would be a permissions issue at that point. Verify they are indeed running as that user (via 'ps' output for example). If that isn't it, it's gotta be some additional Samba configuration item or something.

        You're right---it apparently wasn't doing anything. But Samba is supposed to re-initialize from smb.conf every 60 seconds, or so I thought ...

        Anyway, I did a HUP on smbd and all of a sudden my changes showed up. I retained two of the changes to the smb.conf file, I'm not sure which ultimately worked or whether it was a combination thereof:

        • I added smbusers and a username map line to smb.conf as described earlier.
        • I added guest account = apache, and guest ok = yes to the share definition.

        Also, I had earlier set the umask at wardk's and your suggestion for both apache and the Samba user as well as setgid on the apache document root where the share is located.

        Thanks to all for your help!