Enable Gentoo/Samba Authentication

Posted on 2009-02-19
Last Modified: 2013-12-09
Dear Experts,

I have a fairly standard install of Samba on a fairly simple Gentoo system. (when I say simple, I mean it's "out the box" as it installed - very few modifications by me)

I have one share /data which points to /dev/sdb1, and this is nicely served to a windows network.

The question is, how do I make this share more secure by adding authentication?
Reason: Anyone who gained access to network (wireless etc.) could get uncontolled access to the contents of /data.

I can see that there is quite a bit on the web about this, but don't understand how to get it working on my setup. I see many references to but this does not seem to be available on Gentoo.

Surely there's people out there who have done this... Any help (or even better a solution) much appreciated.


Question by:phil8258
    LVL 23

    Accepted Solution

    Put "security = user" line in your [global] section in smb.conf (you may have now "security = share", if so - change this).
    Then, you need to create users which samba will accept:
    smbpasswd -a username
    By default samba is looking for password file in ${prefix}/private/smbpasswd. You may change this, specifying "smb passwd file = /path/to/your/passwd/file"
    Then, you should modify your share to allow logged in users only: "guest ok = no", or you may allow only specific users by adding: "guest ok = no" and "valid users = username1 username2"
    You may also specify list of users who are not allowed to access this share, by adding: "invalid users = username3 username4"

    Author Closing Comment

    Great, Cheers.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
    This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now