路虽弥,不行不至;事虽少,不做不成。
分类: LINUX
2007-04-25 11:26:52
Step 1: Configure MySQL |
The following inserts the root user and a sample user both with a password of "secretpw". The password encryption is done via MySQL's ENCRYPT function. insert the following SQL:
|
Step 2: Configure PAM |
pam_mysql has the following configuration options available:(options in parentheses are defaults)
Append the following to your /etc/pam.conf file samba auth required pam_mysql.so user=root passwd=secretpw -> db=samba_auth table=users usercolumn=login crypt=1 samba account required pam_mysql.so user=root passwd=secretpw -> db=samba_auth table=users usercolumn=login crypt=1 samba password required pam_mysql.so user=root passwd=secretpw -> db=samba_auth table=users usercolumn=login crypt=1 samba session required pam_mysql.so user=root passwd=secretpw -> db=samba_auth table=users usercolumn=login crypt=1 |
Step 3: Configure Samba |
the following is a sample smb.conf file
# Samba config file # Date: 2000/11/13 12:31:50 # Global parameters [global] workgroup = WORKGROUP-NAME server string = samba file services at WORKGROUP-NAME security = USER #must be set to 'no' to use PAM encrypt passwords = No update encrypted = No allow trusted domains = Yes min password length = 6 null passwords = No revalidate = No [homes] valid users = sample writeable = Yes [www] path = /www valid users = sample force group = http writeable = Yes [public] path = /samba/public valid users = sample writeable = Yes guest ok = No |
Step 4: Test |
Make sure MySQL and Samba are running. If Samba was running before restart it. Create a unix user called "sample" and login to that account. Use smbclient to test by doing the following:
% smbclient \\\\localhost\\sample smbclient will then ask for a password, use 'secretpw', or whatever you made the password, then see if it works. You should be able to do an 'ls', 'mkdir', or 'cd' when you are in smbclient. You should also test this out on a Windows machine to make sure it works. If you aren't using Windows NT or 2000 make sure you 'log-in' to the machine as 'sample'. |