1.為了整合Microsoft OS以及Linux OS的使用者,將Linux Server加入現有的Active Directory網域,以便讓使用者可以直接使用AD帳密即可存取Linux的Server。
(1)安裝Winbind
$ yum -y install samba-winbind
(2)執行認證程式-system-config-authentiction(圖形介面狀態下)
(3)重新啟動下列服務開機時自動啟動
$service smb restart
$service nmb restart
$service winbind start
$service nscd restart
(4)測試登入
2.設定認證程式(圖形介面)
3.如果是非圖形介面,要加入AD網域則需要編輯nsswitch、samba、kerbors服務、pam系統驗證、pam系統驗證等相關組態檔:
(1)nsswitch設定 /etc/nsswitch.conf
passwd: files winbind
shadow: files winbind
group: files winbind
netgroup: files
automount: files
(2)smb設定/etc/samba/smb.conf
workgroup = shark
security = ads
password server = dc1.shark.org
realm = shark.org
idmap uid = 16777216-33554431
template shell = /bin/bash
winbind use default domain = false
winbind offline logon = false
(3)krb5設定/etc/krb5.conf
[libdefaults]
default_realm = SHARK.ORG
dns_lookup_realm = false
dns_lookup_kdc = false
[realms]
SHARK.ORG = {
kdc = dc1.shark.org
}
(4)system-auth設定/etc/pam.d/system-auth
auth sufficient pam_winbind.so use_first_pass
account [default=bad success=ok user_unknown=ignore] pam_winbind.so
password sufficient pam_winbind.so use_authtok
(5)將電腦加入網域
$realm join shark.org
4.測試
$wbinfo -u /檢視AD的使用者帳號/
$wbinfo -a "username" /測試AD驗證/
$getent passwd /檢視所有LInux帳戶以及AD帳戶/
(1)安裝Winbind
$ yum -y install samba-winbind
(2)執行認證程式-system-config-authentiction(圖形介面狀態下)
(3)重新啟動下列服務開機時自動啟動
$service smb restart
$service nmb restart
$service winbind start
$service nscd restart
(4)測試登入
2.設定認證程式(圖形介面)
3.如果是非圖形介面,要加入AD網域則需要編輯nsswitch、samba、kerbors服務、pam系統驗證、pam系統驗證等相關組態檔:
(1)nsswitch設定 /etc/nsswitch.conf
passwd: files winbind
shadow: files winbind
group: files winbind
netgroup: files
automount: files
(2)smb設定/etc/samba/smb.conf
workgroup = shark
security = ads
password server = dc1.shark.org
realm = shark.org
idmap uid = 16777216-33554431
template shell = /bin/bash
winbind use default domain = false
winbind offline logon = false
(3)krb5設定/etc/krb5.conf
[libdefaults]
default_realm = SHARK.ORG
dns_lookup_realm = false
dns_lookup_kdc = false
[realms]
SHARK.ORG = {
kdc = dc1.shark.org
}
(4)system-auth設定/etc/pam.d/system-auth
auth sufficient pam_winbind.so use_first_pass
account [default=bad success=ok user_unknown=ignore] pam_winbind.so
password sufficient pam_winbind.so use_authtok
(5)將電腦加入網域
$realm join shark.org
4.測試
$wbinfo -u /檢視AD的使用者帳號/
$wbinfo -a "username" /測試AD驗證/
$getent passwd /檢視所有LInux帳戶以及AD帳戶/
留言
張貼留言