- 追加された行はこの色です。
- 削除された行はこの色です。
#contents
*インストール [#w3163478]
# yum install samba samba-client samba-common samba-swat
*SWATを動作させる [#q1fe8890]
ブラウザから管理できるように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を使用する場合 [#id67a3a6]
事前にこちらで[[ユーザーを一元管理 LDAP]]OpenLDAPを利用できるようにしておく~
事前にこちらで[[ユーザーを一元管理 LDAP]]OpenLDAPを利用できるようにしておく
**OpenLDAPの追加設定 [#ob41a5aa]
# 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のインストール [#rbfff3d5]
まずは必要なPerlモジュールをインストール
# yum install perl-Digest-SHA1 perl-LDAP
# tar xvzf Crypt-SmbHash-0.12.tar.gz
# cd Crypt-SmbHash-0.12
# perl Makefile.PL
# make
# make test
# make install
ここからダウンロード~
http://sourceforge.net/projects/smbldap-tools/
**UNIXユーザーの情報をLDAPに格納する設定 [#x6780373]
# authconfig
#ref(authconfig.gif,nolink,center)
「Use LDAP」と「Use LDAP Authentication」にチェック
#ref(authconfig2.gif,nolink,center)
「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
*OpenLDAPの追加設定 [#ob41a5aa]
# cp /usr/share/doc/samba-3.0.10/LDAP/samba.schema /etc/openldap/schema/
# vi /etc/openldap/slapd.conf
include /etc/openldap/schema/samba.schema
*.DS_Storeファイルがうざい [#jd79e6d0]
# vi /etc/samba/smb.conf
veto files = /.AppleDB/.AppleDouble/.AppleDesktop/.DS_Store/Network Trash Folder/TheFindByContentFolder/TheVolumeSettingsFolder/