実現したいこと
CentOS7環境でLDAP環境構築を行っております。
LDAPユーザの認証をsssdサービスを使って行っております。
sssdサービスを使って認証うけたLDAPユーザが、ローカルサーバのrootユーザとして、変更したいと考えております。
現在できること
- サーバのローカルユーザ(centos:wheelグループに所属)で、rootになることはできる。
- ローカルユーザ(centos)でLDAPユーザ(unyo)としてsuすることはできる。
su - unyo
unyoユーザで、suコマンドでrootユーザになることは可能なのでしょうか?
発生している問題・エラーメッセージ
上記unyoユーザかrootユーザになろうとすると下記メッセージが出力されて失敗します。
# su - centos $ su - unyo パスワード: -bash-4.2$ id uid=2001(unyo) gid=2001(ope) groups=2001(ope) $ su - パスワード: su: 拒否されたパーミッション $
実行コマンド・設定ファイル
http://blog.father.gedow.net/2015/09/29/sssd-ldap-sudo/
https://teratail.com/questions/92368
等を参考にして下記コマンドを入力で環境を構築しております。
# yum install sssd sssd-client sssd-ldap openldap-clients # systemctl enable sssd # cp /usr/share/doc/sssd-common-1.16.2/sssd-example.conf /etc/sssd/sssd.conf # chmod 600 /etc/sssd/sssd.conf # authconfig --enablesssd --enablesssdauth --enablelocauthorize --enableldap --enableldapauth --disableldaptls --update # vi /etc/sssd/sssd.conf --------------------------一部抜粋----------------------------- [sssd] config_file_version = 2 services = nss, pam, ssh, sudo # SSSD will not start if you do not configure any domains. # Add new domain configurations as [domain/<NAME>] sections, and # then add the list of domains (in the order you want them to be # queried) to the "domains" attribute below and uncomment it. domains = LDAP [nss] [pam] # Example LDAP domain [domain/LDAP] id_provider = ldap auth_provider = ldap ldap_schema = rfc2307 ldap_uri = ldap://test104 ldap_search_base = dc=excample,dc=com ldap_sudo_search_base = ou=Group,dc=excample,dc=com ldap_id_use_start_tls = False ldap_tls_reqcert = allow --------------------------一部抜粋----------------------------- # systemctl start sssd # su - centos $ su - unyo パスワード: -bash-4.2$ id uid=2001(unyo) gid=2001(ope) groups=2001(ope) $ su - パスワード: su: 拒否されたパーミッション $
試したこと
idコマンドで出力されたグループもrootになれるよう、
/etc/sudoersに下記行をvisudoで追記しても結果は同じでした。
%ope ALL=(ALL) ALL
ldapサーバのログを/var/log/ldaplogに出力して確認しておりますが、
unyoユーザのLDAP認証自体はうまくbindできている内容が出ておりました。
その他
CentOS Linux release 7.6.1810 (Core)
いろいろと資料を見ておりますが、今回の行いたい内容そのものズバリという情報が見つからず、
質問させていただきました。
また、説明・情報が不足であればご指摘いただければと思います。
よろしくお願いいたします。
回答4件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/21 23:58
2019/05/22 11:42