Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Problem

I have some difficulties with sharing folders in a local area network by using samba. I have managed everything up to the point that every folder that I share is being detected, can be read and can be written to. My problem however is, that next to the folders that I have explicitly shared, also my /home/carlos folder can be accessed. So basically all my data is exposed unintentionally. Currently I have my firewall blocking samba, so nothing is exposed at the moment, however I want to use samba though. I would like some assistance in correctly configuring samba.

What have I done so far

Copied default configuration file:

cp /etc/samba/smb.conf.default /etc/samba/smb.conf

Changed workgroup from MYGROUP into Baptista and add these lines to the [global] section in /etc/samba/smb.conf:

usershare allow guests = Yes
usershare max shares = 100
usershare owner only = False

Changed [homes] section configuration to read

[homes]
    comment = Home Directories
    browseable = No
    writable = No

Run these commands in a terminal:

# mkdir /var/lib/samba/usershares
# chgrp users /var/lib/samba/usershares/
# chmod 1775 /var/lib/samba/usershares/
# chmod +t /var/lib/samba/usershares/

(these commands and several settings were taken from section 1.7 of https://wiki.archlinux.org/index.php/Samba/Troubleshooting)

Share a folder by launching Dolphin, right-click a folder, select properties, select the share tab, configure settings and press OK.

Question

Let assume I shared the folder /home/carlos/Music, then not only is /home/carlos/Music available through samba, my entire /home/carlos is available. How can I fix this, such that only the folders than I explicitly share, are shared?

System information

  • Chakra Linux, 64-bit
  • Linux kernel 3.12.6-1
  • KDE 4.12.0
  • Qt 4.8.5
  • Samba 4.1.1-1
  • Two laptops, same OS, same username
share|improve this question
    
Are you sure that [home] section isn't actually [homes] (plural)? –  Patrick Jan 21 at 4:22
    
Yes you are right it was a typo –  cfbaptista Jan 21 at 5:46

2 Answers 2

Your home directory is not being exposed. The [homes] section is a special section within the samba config. Basically it makes the home directory of the user you are logging in as accessible. So if you connect to samba as cfbapista, then it will make the home directory of cfbapista accessible. If the user johndoe connects, they will only see the home directory for johndoe, and not cfbapista.

You can find more details about the section in the smb.conf man page.

share|improve this answer

I have solved my problem by commenting out [homes] and all its fields.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.