LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to password protect a folder in samba? (https://www.linuxquestions.org/questions/linux-server-73/how-to-password-protect-a-folder-in-samba-764440/)

Jon W 10-25-2009 11:04 PM

How to password protect a folder in samba?
 
I've been trying to figure out for awhile how to password protect just one folder in my samba main directory.

To explain I have a family here that also uses the file server... So there is files on the file server they use too but I want to show my web folder on the samba server too but I don't want anyone but me being able to get into the folder changing or anything, or even viewing it without a password first. How would this be done?

acid_kewpie 10-26-2009 03:09 AM

not a networking question. moved to Linux - Server.

Jon W 10-26-2009 06:25 PM

Does anyone know the answer to this question?

GaHillBilly 10-26-2009 08:23 PM

Yea. I do that.

One way is to create a folder, say /home/family and share it twice in Samba, once as "family" and again as "family-ro". Make the first share accessible r/w to yourself and whoever, and the second accessible to everyone r/o.

GaHillBilly

Jon W 10-26-2009 08:30 PM

I don't think I quite follow you. Can you elaborate on this?

GaHillBilly 10-27-2009 05:22 AM

I didn't read your original post well enough. I don't know how to protect one folder INSIDE of an existing r/w share. To do what I wrote, you'd need to create a second folder OUTSIDE the original share. Then you can share this second folder two ways, r/w and r/o, depending on who's trying to access it.

(I'm actually not sure what would happen if you tried to share a folder r/o inside an existing r/w share.)

GaHillBilly

acid_kewpie 10-27-2009 06:57 AM

Just a case of setting the right security in your smb.conf for that specific share. I believe if you set "valid users = yourusername" and then configure smbpasswd correctly, then only you would be able to access that specific share.


All times are GMT -5. The time now is 05:51 PM.