未解決

taroyama

が更新しました

1か月前

T

taroyama

1 Rookie

•

3 投稿

•

12 ポイント

0

126

2026年8月26日 04:44

SONiC OSでLDAP認証に失敗する

こんにちは。

私はS5248FスイッチをEnterprise SONiCの4.5.3-Enterprise_Standardで使用しています。

スイッチへのログインに、LDAP認証を使用したいと考えています。
設定した内容は以下の通りです。

SW02# show running-configuration | grep ldap
aaa authentication login default group ldap local
ldap-server base DC=test,DC=local
ldap-server binddn CN=Administrator,CN=Users,DC=test,DC=local
ldap-server bindpw U2FsdGVkX1+Mmz1m+SOMbjIUOSYQ3ynFxZpkNBz1xP8= encrypted
ldap-server vrf mgmt
ldap-server host 10.30.122.100 port 389 priority 1
ldap-server map attribute uid to sAMAccountName
ldap-server map remote-groups-override-to-sonic-roles team1 to admin
ldap-server map objectclass posixAccount to user

SW02# show ldap-server
---------------------------------------------------------
LDAP Global Configuration
---------------------------------------------------------
base                 : DC=test,DC=local
bind-dn              : CN=Administrator,CN=Users,DC=test,DC=local
bindpw configured    : Yes
vrf-name             : mgmt
---------------------------------------------------------
LDAP NSS Configuration
---------------------------------------------------------
bindpw configured    : No
---------------------------------------------------------
LDAP PAM Configuration
---------------------------------------------------------
bindpw configured    : No
---------------------------------------------------------
LDAP SUDO Configuration
---------------------------------------------------------
bindpw configured    : No
--------------------------------------------------------------------------------
HOST            USE-TYPE  PORT      PRIORITY SSL       RETRY
--------------------------------------------------------------------------------
10.30.122.100   -         389       1        -         -
---------------------------------------------------------
LDAP Maps
---------------------------------------------------------
ATTRIBUTE:
  sAMAccountName       : uid
OBJECTCLASS:
  user                 : posixAccount
CUSTOM_SONIC_ROLES_ATTRIBUTE_VALUE:
  admin                : team1
SW02#


この設定でSSHによるアクセスを試していますが失敗します。
LDAPサーバ側でパケットキャプチャを見ると、LDAPの認証は成功しています。
しかし、Tera Termのプロンプトでは再びパスワードを確認され、機器へログインできない状態です。
解決方法をご存知の方がいましたらご教授いただけますでしょうか。

  • taroyama

    1 Rookie

    •

    3 投稿

    •

    12 ポイント

    2

    0

    投稿済み 2026年8月26日 06:48

    先ほどLADP認証は成功していると書きましたが成功していないようです。
    赤枠がSONICのパケットですが、useraのパスワードのレスポンスが無いように見えます。
    緑枠は他製品でAD認証して成功したパケットですが内容がかなり異なるようです。

    LDAPサーバにはWindows ADを使用しているのですが、

    解決方法をご存知の方がいましたらご教授いただけますでしょうか。

  • bf001

    1 Rookie

    •

    15 投稿

    •

    81 ポイント

    3

    1

    投稿済み 2026年8月27日 00:10

    @taroyama​ 
    中の人でなくて&スイッチでldap認証を実装したことがないので恐縮ですが、気になった箇所をコメントさせてください。

    ・ldap-server map objectclass posixAccount to user

     ADのオブジェクト側にposixAccount設定されているか確認してみてください。
    (無くても動く気がするので削ってみるとか。)

    Get-ADUser testuser -Properties objectClass
    ・ADサーバ側の認証ログやSONIC側でsyslog等を取っていればそちらを見てみるのも有益かもしれないです。
    ・ldapなのかldapsなのか
     多分ldapだと思いますが念のため。。
    頑張ってみてください。

     

  • taroyama

    1 Rookie

    •

    3 投稿

    •

    12 ポイント

    2

    0

    投稿済み 2026年8月27日 08:52

    @bf001​ 

    ありがとうございます、原因が分かりました。

    SONiCのLDAPはOpenLDAP仕様なので、OpenLDAPが求めるAttributeをAD側で付与する必要がありました。

    (ldap-server map attributeやldap-server map objectclassだけでは対応できず。)

     

    SW02# show running-configuration | grep ldap
    aaa authentication login default group ldap local
    ldap-server retry 1
    ldap-server timelimit 2
    ldap-server idle-timelimit 2
    ldap-server bind-timelimit 2
    ldap-server base DC=test,DC=local
    ldap-server pam-login-attribute sAMAccountName
    ldap-server binddn CN=Administrator,CN=Users,DC=test,DC=local
    ldap-server bindpw ##########
    ldap-server vrf mgmt
    ldap-server host 10.30.122.100 port 389 priority 1
    ldap-server map attribute homeDirectory to unixHomeDirectory
    ldap-server map attribute uid to sAMAccountName
    ldap-server map remote-groups-override-to-sonic-roles team1 to admin
    ldap-server map objectclass posixAccount to user
    SW02#

     

    上記設定のうえ、パケットを見ながらAttributeを付与しログインできることは確認できました。

    ただし、teams1のユーザに対してadminの権限が付与されず、sonic-cliには入れませんでした。

    権限の付与方法について設定の過不足があるのでしょうか?

  • bf001

    1 Rookie

    •

    15 投稿

    •

    81 ポイント

    2

    0

    投稿済み 2026年8月27日 09:31

    @taroyama​ 

    返信ありがとうございます。

    外部リンクなので共有するかちょっと迷ったのですが、

    LDAP Authentication Testing for Dell Enterprise SONIC ←DellのGithubです

    ldap-server map objectclass posixGroup to group

    team1がグループなら上のコマンドが必要かも?って思いました。

    解決していないですが下のUSコミュニティもありました。

    Configure LDAP groups associate with User Roles on Switch Dell S5248F-ON - SONiC Distribution v4.2.2

     

    頑張ってください。