1

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.

3 Answers 3

1

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.

1
  • 1
    Indeed it won't work; man smb.conf, then look at the "passdb backend" parameter; you can only use smbpasswd, tdbsam, or ldapsam. May 24, 2012 at 9:11
1

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)

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .