shared folder in samba [SOLVED]

Archived topics about LMDE 1 and LMDE 2
Locked
zasz

shared folder in samba [SOLVED]

Post by zasz »

Hello, I just installed Linux Mint Debian Edition 64-bit version.
I have shared various folders according to the instructions in this thread:
http://forums.linuxmint.com/viewtopic.php?f=42&t=23169
and all good, except that from the windows machine where I connect, I see I have shared folders with appropriate permissions, but also is my personal user folder complete with all the folders and documents contained therein, with read-only access. I have No shared It. Is there any way to prevent that folder is shared? I googled a lot and searched the forum but I have not seen anything like it. I guess I am doing something wrong, but not see it.

I posted this problem in the spanish subforum without response, I hope not bother anyone by posting it here.
A greeting and thanks in advance.

Here is the outputs from testparm-s net usershare info in case they are useful. I have only shared the folder "temp" but I also see my user folder.

Code: Select all

    zasz@astaroth ~ $ testparm -s
    Load smb config files from /etc/samba/smb.conf
    rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
    Processing section "[homes]"
    Processing section "[printers]"
    Processing section "[print$]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    [global]
       workgroup = RED
       server string = %h server
       map to guest = Bad User
       obey pam restrictions = Yes
       pam password change = Yes
       passwd program = /usr/bin/passwd %u
       passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
       unix password sync = Yes
       syslog = 0
       log file = /var/log/samba/log.%m
       max log size = 1000
       dns proxy = No
       usershare allow guests = Yes
       panic action = /usr/share/samba/panic-action %d

    [homes]
       comment = Home Directories
       valid users = %S
       create mask = 0700
       directory mask = 0700
       browseable = No

    [printers]
       comment = All Printers
       path = /var/spool/samba
       create mask = 0700
       printable = Yes
       browseable = No

    [print$]
       comment = Printer Drivers
       path = /var/lib/samba/printers


    zasz@astaroth ~ $ net usershare info
    [temp]
    path=/home/temp
    comment=
    usershare_acl=Everyone:F,
    guest_ok=n
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: shared folder in samba

Post by altair4 »

From your description the likely culprit is the [homes] section:
[homes]
comment = Home Directories
valid users = %S
create mask = 0700
directory mask = 0700
browseable = No
The [homes] share is a special share that allows a remote user that has the same user name to have access to his corresponding home directory on the Linux server. If you don't want that to happen then "comment out" the section in /etc/samba/smb.conf by placing a "#" sign in front of each line.

The only problem is that Samba passes the default smb.conf with the [homes] section definition scattered all over the place and not in one neat little subsection. So go into smb.conf and look for this section and place # in front of each line:
#======================= Share Definitions =======================
#[homes]
# comment = Home Directories
# browseable = no


# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
# read only = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
# create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
# directory mask = 0700
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
# valid users = %S
# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
Then restart samba:

Code: Select all

sudo service samba restart
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
zasz

Re: shared folder in samba [SOLVED]

Post by zasz »

Great!!! that solved the problem. Thanks a lot.
Locked

Return to “LMDE Archive”