LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   About private shares in Samba (https://www.linuxquestions.org/questions/linux-software-2/about-private-shares-in-samba-430905/)

ALInux 04-02-2006 05:50 AM

About private shares in Samba
 
Hi.. Ive got Samba up and running but Ive just one simple question.Ive Got a linux fileserver and two XPs at home...Ive Got 4 users for the two XPs but all of them use the same profile "i.e. no different login and usernames" when you start the XP it just opens a profile and you start using the PC..the question is in Samba if I want to create a private share for each of the users...can I do that and then add the user to the samba users..or does the user have to have a windows login username that matches the user who is assigned the samba share in smb.conf

Can I create 4 shares for users A B C D ...and let the owner of the share use his share from anywhere on the network

And please could someone tell me how to set the permissions for the directories if it works

haymaker2000 04-03-2006 12:34 AM

So, does that mean you want to have 2 (or more) users with the same smb username but with different passwords? If you mean that, I'm afraid it wouldn't work, because you need different passwords for different users, at least if you create the user in /etc/passwd (through #useradd user). But I might be wrong. Maybe there is a workaround, that I'm not aware of.

ALInux 04-03-2006 04:07 AM

You mean if I use security = user
but what if I use security = share

ARC1450 04-03-2006 08:28 AM

Yes, you can do that.

Just add them to Samba (smbpasswd -a (blahuser)), then create a folder for them on the server (in the example, //home/blahuser). When they pass their credentials, you can have Samba direct them to a folder no problem.

Something like this will direct a user to a directory under the /home share with their username, then make them the owner of the file and no one else will be able to open it.

Code:

[Users]
        comment = User files
        path = /home/%U
        public = no
        read only = no
        writable = yes
        browseable = yes
        create mode = 0700
        force create mode = 0700
        directory mask = 0700
        force group = users

That's a modification of what I use on my Samba server at home. No matter if a user browses to that share or if they type it into the run box (ie, \\servername\users), it will redirect them to /home/username. That's how I keep my wife out of my home directory and vice versa.

Also, security = share is a pain in the arse.

ALInux 04-03-2006 11:52 AM

So I have to create the corresponding linux users first..right..? Or do I just have to create the directories in the /home directory ?

Also, security = share is a pain in the arse. "and I must set security to user"

ARC1450 04-03-2006 01:27 PM

You need a Linux account. "useradd -d /dev/null -s /bin/false (username) && passwd (username)" is a great way to do it. Just give them some crap password, as it really just needs an account for the smbpasswd -a.

Then create the directory in /home (make sure it's spelled exactly like the username).

ALInux 04-03-2006 03:11 PM

Ok I will try that and get back to you


All times are GMT -5. The time now is 11:17 PM.