インストール

# yum install samba samba-client samba-common samba-swat

SWATを動作させる

ブラウザから管理できるようにSWATを動作させます

# vi /etc/hosts.allow

swat: 192.168.0.1

# vi /etc/xinetd.d/swat

service swat
{
        port            = 901
        socket_type     = stream
        wait            = no
        only_from       = 127.0.0.1 192.168.0.1
        user            = root
        server          = /usr/sbin/swat
        log_on_failure  += USERID
        disable         = yes
}

# /etc/rc.d/init.d/xinetd restart

http://www.example.com:901/ でアクセス可能
ただしSWAT経由で編集するとコメントが削除されたり、並び順が変わったりするので注意が必要

認証にLDAPを使用する場合

事前にこちらでユーザーを一元管理 LDAPOpenLDAPを利用できるようにしておく

OpenLDAPの追加設定

# cp /usr/share/doc/samba-3.0.23c/LDAP/samba.schema /etc/openldap/schema/
# vi /etc/openldap/slapd.conf

include         /etc/openldap/schema/samba.schema

lastmod on

# UNIX password access
access to attribute=userPassword
    by dn="cn=Manager,dc=example,dc=com" write
    by anonymous auth
    by self write
    by * none

# Samba password access
access to attribute=sambaLMPassword,sambaNTPassword
    by dn="cn=Manager,dc=example,dc=com" write
    by self write
    by * none

# default access
access to *
    by dn="cn=Manager,dc=example,dc=com" write
    by * read

smbldap-toolsのインストール

まずは必要なPerlモジュールをインストール

ここからダウンロード
http://sourceforge.net/projects/smbldap-tools/

# rpm -ivh smbldap-tools-0.9.2-1a.noarch.rpm

UNIXユーザーの情報をLDAPに格納する設定

# authconfig
authconfig.gif

「Use LDAP」と「Use LDAP Authentication」にチェック

authconfig2.gif

「Server」に「ldap://127.0.0.1/」、「Base DN」に「dc=example,dc=com」を入力

以下2ファイルについて設定が反映されているか確認

# cat /etc/ldap.conf

base dc=example,dc=com
uri ldap://127.0.0.1/

# cat /etc/nsswitch.conf

passwd:     files ldap
shadow:     files ldap
group:      files ldap

LDAPで認証し、一致しない場合は従来のsmbpasswdファイルで認証
LDAPサーバ上のSambaパスワード変更時に通常のLDAPパスワードも変更し、Smabaユーザー削除時にLDAPユーザーも削除する設定

# vi /etc/samba/smb.conf

passdb backend = ldapsam:ldap://localhost:389 smbpasswd:/etc/samba/smbpasswd
ldap admin dn = cn=Manager,dc=example,dc=com
ldap suffix = dc=example,dc=com
ldap user suffix = ou=users
ldap passwd sync = Yes
ldap delete dn = Yes

LDAPアクセス時のパスワード設定

# smbpasswd -w secret

.DS_Storeファイルがうざい

# vi /etc/samba/smb.conf
veto files = /.AppleDB/.AppleDouble/.AppleDesktop/.DS_Store/Network Trash Folder/TheFindByContentFolder/TheVolumeSettingsFolder/

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS