Networking NVIDIA NVOS User Manual for InfiniBand Switches

LDAP Authentication and Authorization

NVOS supports LDAP for authentication, authorization, and accounting (AAA) with minimal configuration. You do not need to create user accounts or directories on the switch.

NVOS uses Pluggable Authentication Modules (PAM) and Name Service Switch (NSS) for user authentication. NSS enables PAM to use LDAP to provide user authentication, group mapping, and information for other services on the system.

Supported Features

  • Authentication using PAM: Supports login, SSH, sudo, and su.

  • Runs over the eth0 management interface.

  • Supports up to eight LDAP servers.

LDAP Configuration

LDAP configuration consists of two levels:

  1. Global configuration: settings that apply to all LDAP servers.

  2. Per-server configuration: the priority of each LDAP server.

For the LDAP commands, see LDAP Commands. In the REST API, global settings are under /system/aaa/ldap and per-server settings are under /system/aaa/ldap/server/<server-id>.

LDAP Groups and User Privileges

Assign LDAP users to groups on the LDAP server. NVOS uses the group IDs (GIDs) to decide what the users can do on the switch:

  1. Admin privileged users: 4(adm), 27(sudo), 999(docker), 1001(redis), 995(nvaction), 996(nvapply), 997(nvset)

  2. Monitor privileged users: 4(adm), 998(nvshow)

  3. Non-privileged users: no access to nv commands

LDAP Group Entry Example

The following example shows an LDAP group entry on the LDAP server that adds the user adminuser to the nvaction group:

dn: cn=nvaction,ou=People,dc=itzgeek,dc=local
objectClass: posixGroup
cn: nvaction
gidNumber: 995
memberUid: adminuser

LDAP Secure Connection

You can encrypt the connection between the switch and the LDAP servers.

  • Encryption modes: start-tls and ssl.

  • Default CA certificate bundle: /etc/ssl/certs/ca-certificates.crt.

  • Certificate validation: enabled by default. To skip validation, set cert-verify to disabled; the switch then uses the certificate only to encrypt the connection and does not verify it.

Basic LDAP Configuration Example

The following example configures the global LDAP settings and one LDAP server, then sets LDAP as the first authentication method:

Bash
admin@nvos:~$ nv set system aaa ldap bind-dn <ldap-server-bind-dn>
admin@nvos:~$ nv set system aaa ldap secret "ldap-secret"
admin@nvos:~$ nv set system aaa ldap server <ldap-server-ip>
admin@nvos:~$ nv set system aaa ldap base-dn <ldap-server-base-dn>
# set global aaa configs
admin@nvos:~$ nv set system aaa authentication order ldap local
admin@nvos:~$ nv config apply -y

NSS and PAM work together as follows:

  • NSS specifies the order of the information sources that resolve names for each service. Using NSS with authentication and authorization provides the order and location for user lookup and group mapping on the system.

  • PAM handles the interaction between the user and the system, providing login handling, session setup, authentication of users, and authorization of user actions.

LDAP authentication is sensitive to network delay. For optimal performance, NVIDIA recommends a round trip time of 10 ms or less between LDAP clients and the LDAP server. If latency is between 10 and 50 ms, NVIDIA recommends changing the authentication order to prioritize local authentication before LDAP. For connections with more than 50 ms of latency, authentication might experience unacceptable delays; consider alternative authentication methods.

Configure LDAP Server Settings

Configure the LDAP server settings with NVUE commands.

Connection

Configure the following connection settings:

  • Server: the hostname or IP address of the LDAP server. If you use multiple LDAP servers, you can set a priority for each server.

  • Port: the LDAP server port, if it is not the default (389).

  • Bind credentials: the bind DN and secret for an authenticated (simple) bind. The credentials are optional; without them, the switch uses an anonymous bind.

The following example sets the LDAP server, port, and bind credentials:

admin@nvos:~$ nv set system aaa ldap server ldapserver1
admin@nvos:~$ nv set system aaa ldap port 388
admin@nvos:~$ nv set system aaa ldap bind-dn CN=nvset-admin,CN=Users,DC=rtp,DC=example,DC=test
admin@nvos:~$ nv set system aaa ldap secret 1Q2w3e4r!
admin@nvos:~$ nv config apply

When you use multiple LDAP servers, you can set a priority from 1 to 8 for each server; lower numbers come first. The default is 1. The following example sets the priority of ldapserver2 to 2:

admin@nvos:~$ nv set system aaa ldap server ldapserver2 priority 2

Set the Authentication Order

The authentication order sets which methods NVOS uses to authenticate users, and in what order. By default, NVOS uses local authentication only.

If the order starts with LDAP and the LDAP servers reject the user, NVOS tries local authentication only when failthrough is enabled. If no LDAP server responds, NVOS always tries the next method.

To set the authentication order to start with LDAP before local authentication:

admin@nvos:~$ nv set system aaa authentication order ldap local
admin@nvos:~$ nv config apply

Search Base

When an LDAP client requests information about a resource, the client must connect and bind to the server, then perform one or more resource queries depending on the lookup. All search queries to the LDAP server use the configured search base, filter, and the desired entry (uid=myuser). If the LDAP directory is large, this search takes a long time. To speed up searches, set a more specific search base.

admin@nvos:~$ nv set system aaa ldap base-dn ou=support,dc=rtp,dc=example,dc=test
admin@nvos:~$ nv config apply

LDAP Version

NVOS uses LDAP version 3 by default. To use LDAP version 2:

admin@nvos:~$ nv set system aaa ldap version 2
admin@nvos:~$ nv config apply

LDAP Timeouts

NVOS provides two timeout settings:

  • The bind timeout sets the number of seconds before the bind operation times out. You can set 1 to 60 seconds; the default is 5.

  • The search timeout sets the number of seconds before the search times out. You can set 1 to 60 seconds; the default is 5.

The following example sets both the bind timeout and the search timeout to 60 seconds:

admin@nvos:~$ nv set system aaa ldap timeout-bind 60
admin@nvos:~$ nv set system aaa ldap timeout-search 60
admin@nvos:~$ nv config apply

SSL Options

You can configure the following SSL options:

  • SSL mode: none (default), ssl, or start-tls.

  • SSL port (default 636).

  • Certificate validation: enabled (default) or disabled.

  • TLS version (tls-ciphers): TLS1.2, TLS1.3, or all (default).

To use IPv6 with SSL or StartTLS, set the LDAP server by hostname, not by IPv6 address (nv set system aaa ldap server <hostname>). See Configure LDAP Server Settings.

The following example sets the SSL mode to ssl, the SSL port to 8443, enables certificate validation, and sets the TLS version to TLS1.3:

admin@nvos:~$ nv set system aaa ldap ssl mode ssl
admin@nvos:~$ nv set system aaa ldap ssl port 8443
admin@nvos:~$ nv set system aaa ldap ssl cert-verify enabled
admin@nvos:~$ nv set system aaa ldap ssl tls-ciphers TLS1.3
admin@nvos:~$ nv config apply

Show LDAP Settings

To show the LDAP configuration settings on the switch, run the following commands:

  • nv show system aaa ldap shows all the LDAP configuration settings.

  • nv show system aaa ldap server shows the configured LDAP servers and their priorities.

  • nv show system aaa ldap server <server-id> shows the priority for the specified LDAP server.

  • nv show system aaa ldap ssl shows the LDAP SSL configuration settings.

The following example shows all the LDAP configuration settings:

admin@nvos:~$ nv show system aaa ldap
                operational                                          applied
--------------  ---------------------------------------------------  ---------------------------------------------------
bind-dn         CN=nvset-admin,CN=Users,DC=rtp,DC=example,DC=test  CN=nvset-admin,CN=Users,DC=rtp,DC=example,DC=test
base-dn         ou=users,dc=example,dc=com                           ou=users,dc=example,dc=com
port            389                                                  388
timeout-bind    5                                                    5
timeout-search  5                                                    5
secret          $nvsec$4fb719e24167246947d4f746f58696fc              $nvsec$4fb719e24167246947d4f746f58696fc
version         3                                                    3
[server]        ldapserver1                                          ldapserver1
ssl
  mode          ssl                                                  ssl
  port          8443                                                 8443
  cert-verify   enabled                                              enabled
  tls-ciphers   TLS1.3                                               TLS1.3
...

The following example shows the configured LDAP servers and their priorities:

admin@nvos:~$ nv show system aaa ldap server
Hostname     Priority
-----------  --------
ldapserver1  1
ldapserver2  2

The following example shows the SSL configuration settings:

admin@nvos:~$ nv show system aaa ldap ssl
             operational                        applied
-----------  ---------------------------------  ---------------------------------
mode         ssl                                ssl
port         8443                               8443
cert-verify  enabled                            enabled
tls-ciphers  TLS1.3                             TLS1.3

LDAP Verification Tools

The LDAP client daemon retrieves and caches password and group information from LDAP. To verify the LDAP interaction, use these command-line tools to trigger an LDAP query from the switch.

Identify a User with the id Command

The id command performs a username lookup by following the lookup information sources in NSS for the passwd service. This returns the user ID, group ID, and the group list retrieved from the information source. In the following example, the user admin is locally defined in /etc/passwd, and myuser is on LDAP. The NSS configuration has the passwd map configured with the sources compat ldap:

admin@nvos:~$ id admin
uid=1000(admin) gid=1000(admin) groups=1000(admin),4(adm),27(sudo),999(docker),1001(redis),995(nvaction),996(nvapply)
admin@nvos:~$ id myuser
uid=1230(myuser) gid=3000(Development) groups=3000(Development),500(Employees),27(sudo)

Retrieve Records with the getent Command

The getent command retrieves all records found with NSS for a given map. It can also retrieve a specific entry under that map. You can perform tests with the passwd, group, shadow, or any other map in the /etc/nsswitch.conf file. The output from this command formats according to the map requested. For the passwd service, the structure of the output is the same as the entries in /etc/passwd. The group map outputs the same structure as /etc/group.

In this example, looking up a specific user in the passwd map, the user admin is locally defined in /etc/passwd, and myuser is only in LDAP.

admin@nvos:~$ getent passwd admin
admin:x:1000:1000:System Administrator:/home/admin:/bin/bash
admin@nvos:~$ getent passwd myuser
myuser:x:1230:3000:My Test User:/home/myuser:/bin/bash

In the following example, looking up a specific group in the group service, the group admin is locally defined in /etc/group, and netadmin is on LDAP.

admin@nvos:~$ getent group admin
admin:x:1000:
admin@nvos:~$ getent group netadmin
netadmin:*:502:larry,moe,curly,shemp

Running the command getent passwd or getent group without a specific request returns all local and LDAP entries for the passwd and group maps.

Last updated: