Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a htaccess file named mypasswdw as


And is it passible to use this file as samba password file? If then, how to write the smb.conf?

I tried

    comment = test share
    path = /home/public/
    public = no
    writable = yes 
    printable = no
    create mask = 0775
    valid users = user_a user_b
    smb passwd file = /home/conf/mypasswd

It does not work.

share|improve this question
up vote 1 down vote accepted

htaccess files use a different format (Samba password files require extra data like UID, I believe) and a different hashing algorithm, so I don't think there is any way this can work.

share|improve this answer
Indeed it won't work; man smb.conf, then look at the "passdb backend" parameter; you can only use smbpasswd, tdbsam, or ldapsam. – Antonis Christofides May 24 '12 at 9:11

Short answer is no.

A longer answer is probably; you can configure samba to use pam authentication, and therefore any pam module which can parse htaccess files will therefore be able to authenticate users, however authorization becomes an issue - the user ids defined within your htaccess file are independent of the system uids which are used to determine file access. But there is functionality within Samba to deal with this. It's going to be a very long hard struggle with a significant amount of programming. A simpler solution would be to autenticate HTTP users against the system database (mod_auth_pam)

share|improve this answer

The only way this can work is if your file respects the samba password file format: smbpasswd file format

share|improve this answer

Your Answer


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.