Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Samba share password protected
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Samba share password protected

trexostrexos Member
edited March 2015 in General

Hi folks,

I'm locally playing around with samba and I've been using it for quite a time now as local public share. Now I want to use one directory as privat password protected share. I already googled and found a lot configs for making the home directories shareable. But I don't want to share my home directories, I want to share a specific folder under /storage/. As far as I understood I have to create a user first, and then give the user a samba password with this command:

useradd -m -g users USERNAME
passwd USERNAME
smbpasswd -a USERNAME



Then I have to make this share:

[SHARENAME]
path = /storage/myshare
public = no
writable = yes
valid users = USERNAME

Is that correct? I ask here to get sure, because I don't want to f*ck up my config :)

Comments

  • MunMun Member

    if you don't want to share the home directory remove this section / or comment it out.

    [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
    
  • It's not that I only want to deactivate the home share, I want to create a samba share which is password protected. I followed this guide here but it always tells me that the password is wrong. I'm trying from a Windows 7 machine. Here is my samba config: http://pastebin.com/hMKJ5vex

  • Config looks right. Which version of Samba are you dealing with?

    FWIW, you do not need to set the Unix password if you are creating a user only for the purpose of accessing shares via Samba. smbpasswd is all you need.

    What do the logs say?

  • trexostrexos Member
    edited March 2015

    @CharlesA thank you :)

    I use Samba version 3.6.6
    Which logs do you mean?

  • @trexos said:
    CharlesA thank you :)

    I use Samba version 3.6.6
    Which logs do you mean?

    Should be in /var/log/samba/computername.log if I remember right.

  • I have these files under /var/log/samba/ which one is the interesting one?
    cores/ log.nmbd.3.gz log.nmbd.7.gz log.smbd.3.gz log.smbd.7.gz log.nmbd log.nmbd.4.gz log.smbd log.smbd.4.gz log.nmbd.1.gz log.nmbd.5.gz log.smbd.1.gz log.smbd.5.gz log.nmbd.2.gz log.nmbd.6.gz log.smbd.2.gz log.smbd.6.gz

  • NomadNomad Member

    guest ok = no

  • You mean under my user protected share or under the general settings?

  • push

Sign In or Register to comment.