Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a htaccess file named mypasswdw as

user_a:encrypted_password_a
user_b:encrypted_password_b

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

I tried

[TestShare]
    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

3 Answers 3

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
1  
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

 
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.