今更だけどubuntu 22.04→24.04→26.04アップデート(5) まさかのSamba ADが動かず
webサーバーのsambaが問題なく動いていたので見逃していたが、メインADをしているsambaの方が26.04にアップグレード中に起動しなくなった。
Ubuntu 24.04移行、sambaの構成が変わり、smbd/nmbdではなく、samba-ad-dc.serviceに統合されたらしい。
sudo systemctl disable --now smbd nmbd winbind
で無効化。samba-ad-dcが動いているか確認
sudo systemctl unmask samba-ad-dc
Unit samba-ad-dc.service does not exist, proceeding anyway.
Unit samba-ad-dc.service does not exist, proceeding anyway.
ってでてエラー。そもそもインストールされていないのでインストール
sudo apt update
sudo apt install samba-ad-dc winbind
sudo systemctl unmask samba-ad-dc
sudo systemctl enable --now samba-ad-dcsudo samba-tool dbcheck
db確認するとエラーが出るので、以下のコマンドでチェック修正
sudo samba-tool dbcheck --fix
Samba 4.20以降、セキュリティ強化で古いプロファイル記述が無視され、Windows側が「安全ではない」と判断して同期を拒否(または一時プロファイルでログイン)するそうだ。
/etc/samba/smb.conf の編集
[profiles]path = /smb/profileswriteable = yesdirectory mode = 700create mode = 700profile acls = yes
を以下に変更する。
[profiles]
path = /smb/profiles
read only = No
browseable = No
vfs objects = acl_xattr
map acl inherit = Yes
store dos attributes = Yes
# writeable = yes
# directory mode = 700
# create mode = 700
# profile acls = yes
以下で samba 再起動
sudo systemctl restart samba-ad-dc
sudo chown root:root /smb/profiles
sudo chmod 777 /smb/profiles
ここまで来てADが動いていないことが発覚
host -t SRV _ldap._tcp.ドメイン
kinit Administrator@ドメイン
ってしたら、それぞれのコマンドに対してエラーが返ってきた。
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out
;; no servers could be reached
Command 'kinit' not found, but can be installed with:
sudo apt install heimdal-clients # version 7.8.git20221117.28daf24+dfsg-11ubuntu1, or
sudo apt install krb5-user # version 1.22.1-2ubuntu4
OS側のDNSをとめる、ADのDNSを再起動させる
sudo systemctl stop systemd-resolvedsudo systemctl disable systemd-resolved
sudo systemctl restart samba-ad-dc
sudo rm /etc/resolv.conf
/etc/resolv.conf を編集
nameserver 127.0.0.1domain ドメイン名
sudo systemctl restart samba-ad-dc
ケルベロスの再構築
sudo apt install krb5-user dnsutils -y
sudo ln -sf /var/lib/samba/private/krb5.conf /etc/krb5.conf
コメント
コメントを投稿