Networking NVIDIA NVOS User Manual for InfiniBand Switches

TACACS


NVOS supports TACACS+ for AAA (authentication, authorization, and accounting) with minimal configuration. The TACACS+ client implements the protocol as described in RFC 8907. You do not need to create user accounts or directories on the switch. Accounting records go to all configured TACACS+ servers by default.

Configure your TACACS+ servers in addition to the TACACS+ client on the switch. See your TACACS+ server documentation.

Supported Features

  • Authentication using PAM: login, ssh, sudo, and su

  • Runs over the eth0 management interface

  • Up to eight TACACS+ servers

TACACS+ configuration has global settings and per-server settings. If you do not set a per-server setting, the server uses the global setting.

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

TACACS Users

NVOS supports three types of TACACS+ users, based on the privilege level (priv-lvl) set on the TACACS+ server:

  • 15: admin users. They can run all nv commands (nv set, nv unset, nv config apply, and nv show) and any command with sudo.

  • 7: monitor users. They can run nv show commands only.

  • 1: non-privileged users. They cannot run nv commands. Users with any other privilege level have the same access.

TACACS Server Setup and Usage Example

You can set up the TACACS+ server on a remote host, or on the switch itself for testing.

Configure users and clients in the TACACS+ server configuration file (for example, tac_plus.conf).

Users Configuration

user = username {
        login = cleartext "login_password"
        pap = cleartext "pap_password"
        service = exec {
        priv-lvl=<15,7,1>
        }
}

Client Configuration

The client configuration sets the shared key and the client IP addresses that the server accepts:

key = "client-secret"
acl = default   {
                #permit = 192\.168\.0\.
                permit = 192\.168\.0\.30
                permit = .*
}

After you set up the TACACS+ server, configure the client on the switch:

admin@nvos:~$ nv set system aaa tacacs server <tacacs-server-ip> secret tacacs-secret
admin@nvos:~$ nv set system aaa authentication order tacacs local
admin@nvos:~$ nv config apply -y

TACACS+ Accounting

TACACS Accounting Configuration

TACACS+ accounting records user activity and the commands that users run on the switch, and sends the records to the TACACS+ servers. This provides an audit trail for security and compliance. The records go to the first server that responds.

Accounting is disabled by default. After you configure the TACACS+ server and client, enable accounting with the nv set system aaa tacacs accounting state enabled command.

Required TACACS+ Client Configuration

Configure the following required settings on the switch (the TACACS+ client):

  • Set the IP address or hostname of at least one TACACS+ server.

  • Set the secret (key) shared between the TACACS+ server and client.

You must also set the authentication order so that NVOS uses TACACS+.

Each TACACS+ server has a priority from 1 to 8; the default is 1.

The following example commands set:

  • The priority of server 192.168.0.30 to 5.

  • The secret of the server to abcdefghijklmnopqrstuvwxyz.

  • The authentication order, so that NVOS tries TACACS+ authentication before local authentication.

If the secret includes special characters (such as $), enclose it in single quotes (').

admin@nvos:~$ nv set system aaa tacacs server 192.168.0.30 priority 5
admin@nvos:~$ nv set system aaa tacacs server 192.168.0.30 secret abcdefghijklmnopqrstuvwxyz
admin@nvos:~$ nv set system aaa authentication order tacacs local
admin@nvos:~$ nv config apply

If you configure more than one TACACS+ server, set a unique priority from 1 to 8 for each server; the lower number has the higher priority. If the switch cannot connect to the server with the highest priority, it tries the server with the next highest priority. In the following example, server 192.168.0.30 (priority 5) has a higher priority than server 192.168.1.30 (priority 8):

admin@nvos:~$ nv set system aaa tacacs server 192.168.0.30 priority 5
admin@nvos:~$ nv set system aaa tacacs server 192.168.0.30 secret abcdefghijklmnopqrstuvwxyz
admin@nvos:~$ nv set system aaa tacacs server 192.168.1.30 priority 8
admin@nvos:~$ nv set system aaa tacacs server 192.168.1.30 secret zyxwvutsrqponmlkjihgfedcba
admin@nvos:~$ nv config apply

Optional TACACS+ Configuration

You can configure the following optional TACACS+ settings:

  • The port to use for communication between the TACACS+ server and client. The default is port 49.

  • The TACACS+ timeout, which is the number of seconds to wait for a response from the TACACS+ server before trying the next TACACS+ server. You can set 1 to 60 seconds; the default is 5.

  • The TACACS+ authentication type: pap (the default), chap, or login. PAP sends the password in clear text; CHAP uses a challenge-response exchange.

The following example commands set the timeout to 10 seconds and the TACACS+ server port to 32:

admin@nvos:~$ nv set system aaa tacacs timeout 10
admin@nvos:~$ nv set system aaa tacacs server SERVER1 port 32
admin@nvos:~$ nv config apply

The following example command sets the global authentication type to CHAP:

admin@nvos:~$ nv set system aaa tacacs authentication mode chap
admin@nvos:~$ nv config apply

TACACS+ Authorization

By default, the TACACS+ server authorizes a user only at the first login, and NVOS caches the result locally for better performance.

To have the TACACS+ server authorize every session, set the authorization mode to session-remote with the nv set system aaa authorization mode command.

Troubleshooting

Show TACACS+ Configuration

Run the following commands to show TACACS+ configuration:

  • To show all TACACS+ configuration (NVUE hides the secrets), run the nv show system aaa tacacs command.

  • To show the TACACS+ authentication configuration, run the nv show system aaa tacacs authentication command.

  • To show the TACACS+ accounting configuration, run the nv show system aaa tacacs accounting command.

  • To show the TACACS+ servers, run the nv show system aaa tacacs server command.

  • To show the configuration of one TACACS+ server, run the nv show system aaa tacacs server <server-id> command.

The following example command shows all TACACS+ configuration:

admin@nvos:~$ nv show system aaa tacacs
                    applied
------------------  -------
timeout             5
accounting
  state             enabled
authentication
  mode              pap
[server]            5
[server]            8

Incorrect Shared Key

The TACACS+ client on the switch and the TACACS+ server must use the same shared secret. If the secrets do not match, the following message appears in syslog:

2017-09-05T19:57:00.356520+00:00 leaf01 sshd[3176]: nss_tacplus: TACACS+ server 192.168.0.254:49 read failed with protocol error (incorrect shared secret?) user admin

Debug Issues with Accounting Records

If you add or delete TACACS+ servers in the configuration files, notify the audisp plugin:

admin@nvos:~$ sudo killall -HUP audisp-tacplus

If the switch does not send accounting records, add debug=1 to the /etc/audisp/audisp-tac_plus.conf file, then run the command above to notify the plugin. Ask the TACACS+ user to run a command, then check the end of /var/log/syslog for messages from the plugin. You can also check the audit log file, /var/log/audit/audit.log, to make sure the audit records exist. If they do not exist, restart the audit daemon:

admin@nvos:~$ sudo systemctl restart auditd.service

TACACS+ Client Configuration Files

The following table describes the TACACS+ client configuration files that NVOS uses.

Filename

Description

/etc/nsswitch.conf

When the libnss_tacplus package installs, this file configures tacplus lookups through libnss_tacplus. If you replace this file with automation, add tacplus as the first lookup method on the passwd line.

/etc/tacplus_nss.conf

Sets the basic parameters for libnss_tacplus. The file includes a debug variable for debugging NSS lookups separately from other client packages.

/usr/share/pam-configs/tacplus

The configuration file that pam-auth-update uses to generate the files in the next row. These configurations apply to login, su, and ssh.

/etc/pam.d/common-*

Updated for tacplus authentication by pam-auth-update when you install or remove libpam-tacplus.

/etc/audit/audit.rules

The audit rules file, generated when you install auditd.

Last updated: