1.yum install samba, apache, subversion

2.samba configuration

security = server
password server = 192.168.1.2

[homes]
        comment = Home Directories
        browseable = no
        writable = yes
        valid users = yoko-tech.com\personlin


[public]
        comment = Public Stuff
        create mask=755
        path = /data
        public = yes
        writable = yes
        printable = no
        write list = +stuff

3. install modules for apache,使用系統內部預設帳號當作認證方式

mod_dav_svn.so, authnz_external_module,

 

add configuration for external, pwauth, svn

AddExternalAuth pwauth /usr/sbin/pwauth

SetExternalAuthMethod pwauth pipe


<Location /svn>
        DAV svn
        SVNParentPath /var/svn
        AuthType Basic
        AuthName Login
        AuthBasicProvider external
        AuthExternal pwauth
        GroupExternal staff
        require valid-user
</Location>

安裝 pwauth
編輯 config.h 裡的 #define SERVER_UIDS, 將 Apache 執行者的 UID 加入,
例如: #define SERVER_UIDS 48
make
chmod 4755 pwauth (pwauth 需 setuid root, 使能讀取 /etc/shadow)
mv pwauth /usr/sbi

建立 /etc/pam.d/pwauth 內容
auth required /lib/security/pam_pwdb.so shadow nullok
auth required /lib/security/pam_nologin.so
account required /lib/security/pam_pwdb.so

4./etc/fstab 預設mount公司內部的網路,備份資料用

//shares.test.com/內部專用資料夾 /mnt/rd1 cifs auto,username=tester,password=dddd,uid=0,gid=500 0 0

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Person 的頭像
    Person

    Person

    Person 發表在 痞客邦 留言(0) 人氣()