authselect の使い方
ログインの名簿と認証の組み合わせを選ぶ
書き方
authselect current sudo authselect select sssd [with-mkhomedir] --force sudo authselect enable-feature with-faillock
/etc/nsswitch.conf と /etc/pam.d/system-auth・password-auth をまとめて書き換えます。sssd を選ぶと LDAP の利用者も getent・id・ログインで使えます。with-mkhomedir は初めてのログインでホームを作ります(oddjobd が要る)。
よく使うオプション
| オプション | 意味 |
|---|---|
current | 今選んでいる組み合わせと機能を出す |
list | 選べる組み合わせ(sssd・winbind・minimal など)を出す |
select 名前 [機能...] | 組み合わせを選ぶ(--force で今のファイルを上書き) |
enable-feature 機能 | 機能を足す(with-mkhomedir・with-faillock など) |
check | ファイルが手で書き換えられていないか確かめる |
例
$ authselect currentProfile ID: sssd
Enabled features:
- with-mkhomedir
- with-faillock今の組み合わせを出します。
$ sudo authselect select sssd with-mkhomedir --force
LDAP などの利用者で入れるよう sssd を選び、初めてのログインでホームを作る機能も付けます。
$ systemctl is-active oddjobd
with-mkhomedir でホームを作るのは oddjobd です。動いているか確かめ、止まっていれば起動しておきます。
$ getent passwd ops && id ops
LDAP の利用者が、この Linux から見えるようになったか確かめます。
よくある間違い・注意
- authselect が管理しているファイル(/etc/nsswitch.conf や /etc/pam.d/system-auth)を手で書き換えると、次の select で消えます。
- sssd の設定(/etc/sssd/sssd.conf)は別に要ります。権限を 600 にしないと sssd が起動しません。
実際に打って練習する
Linux レベル2 コースの Lv93「名簿でログイン sssd」で覚えます(第7章 伝令と名簿(DHCP・メール・認証))。ブラウザの中のシミュレーターで、本物と同じように打って確かめられます。
すべてのレベルが、ゴールド以上のプランで遊べます。