#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を利用できるようにしておく **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モジュールをインストール~ -Net::LDAP -Digest::SHA1 -[[Jcode:http://dag.wieers.com/rpm/packages/perl-Jcode/]] -[[Unicode::Map:http://dag.wieers.com/rpm/packages/perl-Unicode-Map/]] -[[Unicode::String:http://dag.wieers.com/rpm/packages/perl-Unicode-String/]] -[[Unicode::Map8:http://dag.wieers.com/rpm/packages/perl-Unicode-Map8/]] -[[Unicode::MapUTF8:http://dag.wieers.com/rpm/packages/perl-Unicode-MapUTF8/]] -[[Crypt::SmbHash:http://dag.wieers.com/rpm/packages/perl-Crypt-SmbHash/]] # yum install perl-Digest-SHA1 perl-LDAP # rpm -ivh perl-Jcode-2.06-1.el5.rf.noarch.rpm # rpm -ivh perl-Unicode-Map-0.112-1.el5.rf.i386.rpm # rpm -ivh perl-Unicode-String-2.09-1.2.el5.rf.i386.rpm # rpm -ivh perl-Unicode-Map8-0.12-1.el5.rf.i386.rpm # rpm -ivh perl-Unicode-MapUTF8-1.11-1.2.el5.rf.noarch.rpm # rpm -ivh perl-Crypt-SmbHash-0.12-1.2.el5.rf.noarch.rpm ここからダウンロード~ http://sourceforge.net/projects/smbldap-tools/ # rpm -ivh smbldap-tools-0.9.2-1a.noarch.rpm **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 *.DS_Storeファイルがうざい [#jd79e6d0] # vi /etc/samba/smb.conf veto files = /.AppleDB/.AppleDouble/.AppleDesktop/.DS_Store/Network Trash Folder/TheFindByContentFolder/TheVolumeSettingsFolder/