contents
- インストールと基本設定
- Sambaの認証とユーザ管理
- ファイル共有
- プリンタ共有の設定
- ブラウジングと名前解決
- ノードタイプ
- nmblookup
- NetBIOSを無効
- ブラウジング機能関連パラメタ
- SambaとWindowsドメインとの連携
- security =
- security = domain
- security = ads
- Sambaによるドメインコントローラの構築
- PDC
- BDC
- グローバルグループ
- システムポリシー
- アカウントポリシー
- ユーザ権利
- 移動プロファイル
- 信頼関係
- SambaドメインをWindowsドメインが信頼
- WindowsドメインをSambaドメインが信頼
- LDAP認証
- Sambaのクライアント機能
LPIC302
インストールと基本設定
pamを有効に
インストール後にconfigureオプションを確認
Samba変数
NetBIOS名
ユーザ名
プライマリグループ
セクション(共有)名
共有にアクセスしているユーザ名
%uのプライマリグループ
%uのホームディレクトリ
Sambaの認証とユーザ管理
security =
security = server
= SERVER1
pdbedit | smbpasswd | |
-L --list | sambaユーザの表示 | |
-w --smbpasswd-style | smbpasswd形式 | |
-a ユーザ名 --create ユーザ名 | sambaユーザ追加 | -a |
-x --delete | 削除 | -x |
-i --import | インポート | |
-e --export | エクスポート | |
-b --backend | 操作対象の認証データベース |
認証データベース
smbpasswdファイル smbuser1:UID:LANMANハッシュ:NTLMハッシュ:ユーザフラグ:最終更新時刻
ユーザフラグ
通常
コンピュータアカウント
無期限パスワード
ドメイン間信頼アカウント
ホームディレクトリが必要
サーバ信頼アカウント
無効、ログオンできない
パスワードが無い
ロックされている
Sambaユーザのマッピング
認証データベース
認証データベースの移行
ファイル共有
[share1] path = /home/share1 comment = Share 1 on %H max connections = 10 [homes] browseable = no writeable = yes comment = %U's home directory [ipc$] hosts allow = 192.168.1.0/255.255.255.0 valid users = monyo @users invalid users = test1 test2
guest ok guest only force user force group admin users
create mask force create mode directory mask force directory mode inherit permissions
map archive map hidden map system dos filetime resolution fake directory create times
[global] host msdfs = yes [dfstop] path = /usr/local/samba/lib/dfstop msdfs root = yes # cd /usr/local/samba/lib/dfstop # ln -s msdfs:sakura\\archive archive
表示、読み取り禁止
アクセス権の無いファイルの表示、読み取り禁止
シンボリックリンク禁止
共有外へのアクセス禁止
ゴミ箱
xlsを参照しただけでファイルの更新日が変更されないように
[homes]でアクセスできるユーザを,ユーザホームの所有者のみに
プリンタ共有の設定
[global] printing = bsd [printer1] printable = yes printer name = lp printing = bsd use client driver = Yes path = /tmp
[globals] printcap name = /etc/printcap [printers] printable = yes comment = All printers browseable = no path = /var/spool/samba
printing = cups cups options = raw
[print$] path = /var/lib/samba # ls /var/lib/samba WIN40/ W32X86/
$ net -S server -U admin rpc right grant "DOMAIN\penguin" SePrintOperatorPrivilege
ブラウジングと名前解決
ノードタイプ
nmblookup
NetBIOSを無効
以降でNetBIOSを無効にしてDirect Hosting of SMBのみで構成することが可能。 Sambaでは、
で同様の設定が可能。
ブラウジング機能関連パラメタ
SambaとWindowsドメインとの連携
security =
security = domain
[global]
コンピュータアカウント+ドメイン参加
ドメイン参加のみ
security = ads
[global]
[/etc/krb5.conf] [libdefaults] default_realm = W2003AD1.EXAMPLE.NET [realms] W2003AD1.EXAMPLE.NET = { kdc = adpdc.w2003ad1.example.net } [domain_realm] .w2003ad1.example.net = W2003AD1.EXAMPLE.NET w2003ad1.example.net = W2003AD1.EXAMPLE.NET
認証統合のためには、
を別途作成する必要あり。
を使って、Linuxユーザの作成を自動化できる。
さらに、
によりLinuxユーザの作成が不要になる。
手順:
マッピング情報の表示
ユーザ名に\が含まれることによる誤動作を防ぐには、
あるいは、
とすると、ユーザ名にドメイン名が省略される。
この方式では、マッピング情報がSambaサーバごとに管理されるため、 Sambaサーバ間で不整合が発生する可能性がある。 これを解決するには、
が必要。
設定:
Sambaによるドメインコントローラの構築
PDC
[global] workgroup = SAMBADOM security = user domain logons = Yes passdb backend = tdbsam os level = 32 domain master = auto preferred master = auto local master = yes wins support = yes add machine script = /usr/sbin/useradd -d /dev/null -s /bin/false %u logon home = \\%N\%U logon path = \\%N\%U\profile logon drive = H: logon script = [netlogon] comment = Net Logon Share path = /usr/local/samba/netlogon writeable = No write list = @administrators [profiles] path = /usr/local/samba/lib/profiles writeable = yes browseable = No profile acls = yes
BDC
だけがPDCと異なる。
PDC-BDC間のSID同期
認証データベースの複製
グローバルグループ
domadmというLinuxのグループを既存のDomain Adminsグローバルグループに対応づける
システムポリシー
NT系では
9x系では
を
に置く。
アカウントポリシー
ユーザ権利
をセットすることで、
によりユーザ権利を設定することができる
移動プロファイル
信頼関係
SambaドメインをWindowsドメインが信頼
- 信頼関係用のLinuxユーザを作成、Sambaユーザを作成
- この後Windows側(w2003ad1)で、信頼関係締結処理。
WindowsドメインをSambaドメインが信頼
- Windows側でSambaを信頼
- 信頼関係を確立
LDAP認証
[slapd.conf] include /etc/ldap/shema/core.schema include /etc/ldap/shema/cosine.schema include /etc/ldap/shema/nis.schema include /etc/ldap/shema/inetorgperson.schema include /etc/ldap/shema/samba.schema database ldbm suffix "dc=sample,dc=local" directory "/var/lib/ldap" index objectClass eq rootdn "cn=admin,dc=samba,dc=local" rootpw damedame access to attrs=userPassword by dn="cn=admin,dc=samba,dc=local" write by anonymous auth by self write by * none access to attrs=sambaLMPassword,sambaNTPassword by dn="cn=admin,dc=samba,dc=local" write by * none access to * by dn="cn=admin,dc=samba,dc=local" write by * read Linuxユーザの情報もLDAPに格納 {{code(/etc/ldap.conf) BASE dc=samba,dc=local URI ldap://localhost
[/etc/nsswitch.conf] passwd: files ldap shadow: files ldap group: files ldap
smbldap-toolsの設定
[smbldap_bind.conf] masterDN="cn=admin,dc=samba,dc=local" masterPW="damedame" slaveDN="cn=admin,dc=samba,dc=local" slavePw=" damedame"
[smbldap.conf] suffix="dc=samba,dc=local" usersdn="ou=Users,${suffix}" computersdn="ou=Computers,${suffix}' groupsdn="ou=Groups,${suffix}" Sambaの設定 {{code smb.conf) passdb backend = ldapsam:ldap://localhost:389 ldap admin dn = cn=admin,dc=samba,dc=local ldap suffix = ldap user suffix = ldap group suffix = ldap machine suffix = ldap delete dn = Yes ldap passwd sync = Yes add machine script = /usr/local/samba/bin/smbldap-useradd -a -w "%u" add user script = [netlogon] [homes]
LDAPデータベースの初期化
運用
: :