SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
Samba
Windows ドメイン連携
のすべて
日本Sambaユーザ会
たかはしもとのぶ(髙橋基信) 
monyo@samba.gr.jp
Windows ドメイン連携で実現できること
 要は、Windowsドメインに「参加」できること
Sambaサーバ上のユーザ認証をWindowsドメインに
委任できる
WindowsドメインのユーザやグループをSambaサー
バ上で使える(Winbind機構)
 Samba以外のプロダクトのログイン認証にも利用できる
基本的には、これ以上でも以下でもありません
$ id 'W2K8AD1samba01' ← 指定したユーザのuidとgidを参照
uid=10001(W2K8AD1samba01) gid=10000(W2K8AD1domain users)
groups=10000(W2K8AD1domain users)
ユーザ認証をSambaサーバで実施
SambaSambaサーバサーバ
-rw-r--r– user1 grp1 file1
-rw-r--r– user2 grp2 file2
パーミッションのチェック
WindowsWindows
クライアントクライアント
file1に
アクセス
ユーザ名 :user1
パスワード:passA(MS暗号化)
user1:passA(MS暗号化)
user2:passB(MS暗号化)
user1として認証 /etc/smbpasswdファイル
リソースへのアクセス
Sambaユーザとして
の認証
UID1000でアクセス
user1:pass1(暗号化):1000
user2:pass2(暗号化):1001
/etc/passwdファイル
Linuxユーザと対応
付け(通常同じ名前の
ユーザと対応)
認証情報は使わない
4
ユーザ認証をWindowsドメインで実施
SambaSambaサーバサーバ
-rw-r--r– user1 grp1 file1
-rw-r--r– user2 grp2 file2
リソースへのアクセス
パーミッションのチェック
WindowsWindows
クライアントクライアント
Sambaユーザとして
の認証
ドメインドメイン
コントローラコントローラ
user1:passA(MS暗号化)
user2:passB(MS暗号化)
/etc/smbpasswd
ファイル不要
認証
認証要求
user1として認証
file1に
アクセス
ユーザ名 :user1
パスワード:passA(MS暗号化)
UID1000でアクセス
user1:pass1(暗号化):1000
user2:pass2(暗号化):1001
/etc/passwdファイル
Linuxユーザと対応
付け(通常同じ名前の
ユーザと対応)
認証情報は使わない対応付けのために
/etc/passwdファイルは
依然として必要
1
Winbind機構とは
 ユーザ認証だけでなく、ユーザやグループの情
報もWindowsドメインから取得する機能
 ユーザ認証を委任してもユーザ情報はSambaサーバで
独自に持たないといけないのは不便
設定
 smb.conf
 NSSの設定
 /etc/nsswitch.confファイルの修正
 nss_winbindモジュールのインストール
 PAMの設定(Samba以外の認証も行う場合)
 pam_winbindモジュールのインストール
Winbind機構なし(Windowsドメインで認証)
SambaSambaサーバサーバ
-rw-r--r– user1 grp1 file1
-rw-r--r– user2 grp2 file2
リソースへのアクセス
パーミッションのチェック
WindowsWindows
クライアントクライアント
Sambaユーザとして
の認証
ドメインドメイン
コントローラコントローラ
user1:passA(MS暗号化)
user2:passB(MS暗号化)
/etc/smbpasswd
ファイル不要
認証
認証要求
user1として認証
file1に
アクセス
ユーザ名 :user1
パスワード:passA(MS暗号化)
Linuxユーザと対応
付け(通常同じ名前の
ユーザと対応)
UID1000でアクセス
対応付けのために
/etc/passwdファイルは
依然として必要
user1:pass1(暗号化):1000
user2:pass2(暗号化):1001
/etc/passwdファイル
user1:pass1(暗号化):1000
user2:pass2(暗号化):1001
/etc/passwdファイル
Winbind機構あり
SambaSambaサーバサーバ
-rw-r--r– user1 grp1 file1
-rw-r--r– user2 grp2 file2
リソースへのアクセス
パーミッションのチェック
WindowsWindows
クライアントクライアント
Sambaユーザとして
の認証
ドメインドメイン
コントローラコントローラ
user1:passA(MS暗号化)
user2:passB(MS暗号化)
/etc/smbpasswd
ファイル不要
認証
認証要求
user1として認証
file1に
アクセス
ユーザ名 :user1
パスワード:passA(MS暗号化)
UID1000でアクセス
Linuxユーザと対応
付け(通常同じ名前の
ユーザと対応)
/etc/passwd
ファイル不要
ユーザ情報
連携
user1:1000
user2:1001
Winbind
UNIXユーザ情
報を自動生成
(Idmap機構)
3
対応付けのために
/etc/passwdファイルは
依然として必要
Winbind機構なし
SambaSambaサーバサーバ
-rw-r--r– user1 grp1 file1
-rw-r--r– user2 grp2 file2
リソースへのアクセス
パーミッションのチェック
WindowsWindows
クライアントクライアント
Sambaユーザとして
の認証
ドメインドメイン
コントローラコントローラ
user1:passA(MS暗号化)
user2:passB(MS暗号化)
/etc/smbpasswd
ファイル不要
認証
認証要求
user1として認証
file1に
アクセス
ユーザ名 :user1
パスワード:passA(MS暗号化)
user1:pass1(暗号化):1000
user2:pass2(暗号化):1001
/etc/passwdファイル
Linuxユーザと対応
付け(通常同じ名前の
ユーザと対応)
UID1000でアクセス
ユーザ認証をSambaサーバで実施
SambaSambaサーバサーバ
-rw-r--r– user1 grp1 file1
-rw-r--r– user2 grp2 file2
パーミッションのチェック
WindowsWindows
クライアントクライアント
file1に
アクセス
ユーザ名 :user1
パスワード:passA(MS暗号化)
user1:passA(MS暗号化)
user2:passB(MS暗号化)
user1として認証 /etc/smbpasswdファイル
リソースへのアクセス
Sambaユーザとして
の認証
UID1000でアクセス
user1:pass1(暗号化):1000
user2:pass2(暗号化):1001
/etc/passwdファイル
Linuxユーザと対応
付け(通常同じ名前の
ユーザと対応)
認証情報は使わない
Windows ドメイン連携で実現できること
 要は、Windowsドメインに「参加」できること
Sambaサーバ上のユーザ認証をWindowsドメインに
委任できる(Winbind機構なし)
WindowsドメインのユーザやグループをSambaサー
バ上で使える(Winbind機構あり)
 Samba以外のプロダクトのログイン認証にも利用できる
基本的には、これ以上でも以下でもありません
$ id 'W2K8AD1samba01' ← 指定したユーザのuidとgidを参照
uid=10001(W2K8AD1samba01) gid=10000(W2K8AD1domain users)
groups=10000(W2K8AD1domain users)
自動生成されるユーザ、グループ名の設定
 UNIX流儀に近い名前に変更できる
デフォルトは「Domain NameUsername」
 「」が入るので、扱いが若干面倒
カスタマイズ例
 Domain Name_Username ← 「」を「_」に変更
 domain_nameusername ← すべて小文字&空白を
                    「_」に変更
 Username ← ユーザ名のみに変更
$ getent passwd 'W2K8AD1samba01'
W2K8AD1samba01:*:10001:10000::/home/W2K8AD1/samba01:/bin/false
user1:1000
user2:1001
Winbind
UNIXユーザ情
報を自動生成
(Idmap機構)
W2K8AD1samba01
グループ名もこのカスタマイズの影響を受ける
1
自動生成されるユーザ情報の設定
 ホームディレクトリ,シェルもカスタマイズ可
デフォルトは
「/home/DomainName/Username」と「/bin/false」
変更の方式
 全ユーザ一律で変更
 template shell / template homedir
パラメータを使用
 ユーザごとに変更
 Active DirectoryのUNIX属性にある
ログインシェル、ホームディレクトリ
値を参照させる
$ getent passwd 'W2K8AD1samba01'
W2K8AD1samba01:*:10001:10000::
user1:1000
user2:1001
Winbind
UNIXユーザ情
報を自動生成
(Idmap機構)
/home/W2K8AD1/samba01:/bin/false10001:10000
ログインシェルとホームディレクトリの情報を参照
1
自動生成されるグループ情報の設定
 グループのメンバの参照元に注意
非Winbind環境
 /etc/groupファイルを参照
Winbind環境
 Windows上のマッピング元グループを参照
 UNIX側のグループ情報はGID以外使われない
いくら/etc/groupにユーザを足しても無意味!
ドメイン
コントローラ
グループの
メンバ情報
グループの
メンバ情報
Domain Users
Samba
サーバ
domusers
/etc/group
ファイル
Active
Directory
マッピング
# net groupmap add
$ getent group 'W2K8AD1Domain Users'
W2K8AD1Domain Users:x:10017: W2K8AD1ldap01,W2K8AD1ldap02, …
4
ローカルグループのサポート
 Winbind環境では、Windowsと同様のローカル
グループもサポートされる
Sambaサーバ上のユーザに加え、ドメインのグロー
バルグループやユーザもメンバに追加できる
 こちらも/etc/groupの情報は参照されない
 メンバの追加、削除はWindowsから行うか、専用のコマ
ンド(net sam / net groupmap)経由
Samba
サーバ
ローカルグループ
Winbind機構
Active
Directory
ローカルユーザ
ドメインユーザ
ドメイングループ
アクセス権付与
ユーザ、グループ名指定方法の注意
 smb.confでの設定方法
「DOMAINUser」形式で指定すること
[share]
valid users = +”Domain Users” +monyo
[share]
valid users = +”W2K8AD1Domain Users” +W2K8AD1monyo
※ドメイン名を指定しない場合は、UNIX上のグループ名を指定した
  とみなされる
2
# id W2K8AD1user1
Idmap機構
 自動生成されるユーザにマップされるUIDや
GIDを生成し、その情報を保持するWinbindの
一機構
Winbind
W2K8AD1
ドメインのDC
W2K8AD1user1ユーザの
UIDを教えてください
Idmap機構
W2K8AD1
user1の情報
UIDは1000
です
UID生成 → 1000 uid=1000(W2K8AD1user
1)
SAMBA
サーバ
W2K8AD1user1:1000
Idmap
情報を格納
UNIXユーザ情
報を自動生成
(Idmap機構)
8
Idmapバックエンド
 Idmap情報の生成、保持の方法は選択可能
tdbもしくはridがお勧め
名称 ID生成 格納場所 一元管理 概要
tdb プールから
払い出し
TDB
ファイル
各サーバごと もっとも古い機構で、IDは未使用ID領域から
順に生成される
ldap プールから
払い出し
LDAP
ディレクトリ
可能 TDBと同時期から存在する。ID格納場所を
LDAPにすることで、複数サーバ間で生成し
たIDの一元管理可能な点が特徴
ad /
(adex)
UNIX属性 AD 可能 Active DirectoryのUNIX属性に設定された
UID情報を用いる。LDAPサーバを立てるこ
となく、IDの一元管理が可能
rid /
autorid
計算式 (なし) 可能 Active Directoryの各ユーザ、グループに付
与されているRID値から自動生成された値を
用いる。IDの管理自体が不要
nss /etc/passwdファイル 各サーバごと /etc/passwdのUID情報をそのまま用いる。
LDAPで認証統一している場合などに便利
Idmapバックエンド
 Idmap情報の生成、保持の方法は選択可能
tdbもしくはridがお勧め
LDAP
サーバ
IDプール
Samba
サーバ
IDプール
ドメイン
コントローラ
ユーザ情報
tdbバックエンド
tdbバックエンド
Domainuser1の
UID生成→1000
Domainuser1の
UID生成→
同期されない
ldapバックエンド
1020
Samba
サーバ
参照
参照
同期されている
LDAPの
管理が面倒UNIX属性
参照
参照
個別管理
したくない
adadバックエンドバックエンド
算出
算出
ridバックエンド
15
Idmap機構の設定
 バージョンによって設定方法が異なる
 Samba 3.0.24以前
 全ドメイン一律設定、比較的簡単
 Samba 3.0.25~3.2.X
 ドメインごとにIdmap機構を設定可能、複雑
 複数Idmap機構間で払い出すIDの重複を防ぐ機構(alloc backend機
構)が導入、かなり複雑
 Samba 3.3.0~3.5.X
 3.0.24以前、以降両者の長所を組み合わせ。3.0.24以前の方法はデ
フォルト値として再定義。3.0.25以降の方法でドメインごとにも設定可能
 Samba 3.6.0以降
 alloc backend機構が隠蔽(Samba内部で暗黙的に機能する形に)
 3.0.24以前の設定方法は混乱を避けるため非推奨に。別途デフォルト
値を設定する構文が追加
NIS(LDAP)環境について
 UIDやGIDが生成済→Samba側で生成しては
いけない
非Winbind環境
 通常通り構築可能
 UNIXユーザ、グループは既にNISやLDAPで作成された
ユーザを用いればよい
Winbind環境の場合
 Idmap機構として、必ずidmap_nssを使用すること
 idmap_nssは、UID/GID自動生成をしないIdmapモジュール
 グループのメンバはAD側の情報しか参照されないので
注意(前述の とおり)
 NISのgroupマップやLDAP内のグループ情報は反映されない
※
※
NIS環境-Winbind機構なし
SambaSambaサーバサーバ
-rw-r--r– user1 grp1 file1
-rw-r--r– user2 grp2 file2
リソースへのアクセス
パーミッションのチェック
WindowsWindows
クライアントクライアント
Sambaユーザとして
の認証
ドメインドメイン
コントローラコントローラ
user1:passA(MS暗号化)
user2:passB(MS暗号化)
/etc/smbpasswd
ファイル不要
認証
認証要求
user1として認証
file1に
アクセス
ユーザ名 :user1
パスワード:passA(MS暗号化)
user1:pass1(暗号化):1000
user2:pass2(暗号化):1001
passwdマップ
Linuxユーザと対応
付け(通常同じ名前の
ユーザと対応)
UID1000でアクセス
PAMによる認証のサポート
 pam_winbindにより各プロダクトを認証
 SSHでのログイン時の認証をADのパスワードで行うなど
 nss_winbind(Sambaの動作にも必要)と組み合わせて
用いる
Winbind
ドメインドメイン
コントローラコントローラ
SambaSambaサーバサーバ
認証要求/認証
ユーザ情報
連携
ユーザ、
グループ情報 Samba
pam_winbind
ssh ftp
telnet
認証機能提供(PAM経由)
認証情報提供(独自)
2
Linux(UNIX)
ユーザ情報提供
1000:monyo
1001:damedame
nss_winbind
ご清聴ありがとうございました
 詳細については、「改訂版」Sambaのすべてを
ご参照ください。

Mais conteúdo relacionado

Destaque

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Destaque (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Samba Windowsドメイン連携のすべて(2012/03/17 OSC 2012 Tokyo/Spring)