32
37

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Linuxをドメイン(AD)に参加させる

Posted at

LinuxをWindowsドメイン(AD)に参加させる

「ADでユーザーやらなんやら管理してるけどLinuxだけ管理できてねーぞくそが」
ってとき。

環境
ドメイン:hoge.local
DC:dc1.hoge.local
Linuxマシン:bksv.hoge.local
sambaのインストール
# yum install samba
# yum install samba-winbind
sambaの設定変更
# vi /etc/samba/smb.conf

[global]
workgroup = HOGE
realm = HOGE.LOCAL
security = ads
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
template shell = /bin/false
winbind use default domain = false
winbind offline logon = yes
DNSサーバの設定
# vi /etc/resolv.conf

search hoge.local
nameserver dc1.hoge.local
ケルベロス認証設定
# vi /etc/krb5.conf

[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log

[libdefaults]
default_realm = HOGE.LOCAL
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true

[realms]
HOGE.LOCAL = {
kdc = dc1.hoge.local
admin_server = bksv.hoge.local
}

hoge.local = {
}

[domain_realm]
.hoge.local = HOGE.LOCAL
hoge.local = HOGE.LOCAL
ADへの参加
# net ads join -U hoge_admin ←ドメイン管理者
Enter hoge_admin's password: ←パスワード入力
Using short domain name -- HOGE
Joined 'BKSV' to realm 'hoge.local'
No DNS domain configured for bksv. Unable to perform DNS Update.
DNS update failed!
sambaとwinbindサービスを起動
# service smb start
# service winbind start
PC起動時に自動的に起動するように設定
# chkconfig smb on
# chkconfig winbind on
ドメインに参加できているかの確認
# wbinfo -t
checking the trust secret for domain HNS via RPC calls succeeded

# wbinfo -u
HOGE\guest
HOGE\administrator
HOGE\krbtgt
HOGE\hoge_admin
32
37
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
32
37

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?