Cumulus Linux implements TACACS+ client AAA (Accounting, Authentication, and Authorization) in a transparent way with minimal configuration. The client implements the TACACS+ protocol as described in this IETF document. There is no need to create accounts or directories on the switch. Accounting records are sent to all configuredTACACS+ servers by default. Use of per-command authorization requires additional setup on the switch.
- Authentication using PAM; includes
Runs over the eth0 management interface
- Ability to run in the management VRF
- TACACS+ privilege 15 users can run any command with sudo using the
/etc/sudoers.d/tacplusfile that is installed by the
- Up to seven TACACS+ servers
Installing the TACACS+ Client Packages
TACACS+ requires the following packages to be installed on Cumulus Linux. These packages are not part of the base Cumulus Linux image installation.
To install all required packages, run these commands:
Configuring the TACACS+ Client
After installing TACACS+, edit the
/etc/tacplus_servers file to add at least one server and one shared secret (key). You can specify the
server and secret parameters in any order anywhere in the file. Whitespace (spaces or tabs) are not allowed. For example, if your TACACS+ server IP address is
192.168.0.30 and your shared secret is
tacacskey, add these parameters to the
Cumulus Linux supports a maximum of seven TACACS+ servers. Connections are made in the order in which they are listed in this file. In most cases, you do not need to change any other parameters. You can add parameters used by any of the packages to this file, which affects all the TACACS+ client software. You can also configure some of the packages through individual configuration files. For example, the timeout value (see description below) is set to 5 seconds by default for NSS lookups in
/etc/tacplus_nss.conf, while other packages use a value of 10 seconds in /
When you add or remove TACACS+ servers, you must restart
auditd (with the
systemctl restart auditd command) or you must send a signal (with
killall -HUP audisp-tacplus) before
audisp-tacplus rereads the configuration to see the changed server list.
This is the complete list of the TACACS+ client configuration files, and their use. The full list of TACACS+ parameters is shown in TACACS Parameters below.
|/etc/tacplus_servers||This is the primary file that requires configuration after installation. The file is used by all packages with |
|/etc/nsswitch.conf||When the |
|/etc/tacplus_nss.conf||This file sets the basic parameters for |
|/usr/share/pam-configs/tacplus||This is the configuration file for |
|/etc/sudoers.d/tacplus||This file allows TACACS+ privilege level 15 users to run commands with |
|audisp-tacplus.conf||This is the |
|/etc/audisp/audisp-tac_plus.conf||This is the TACACS+ server configuration file for accounting. Typically, no modifications are required. You can use this configuration file when you only want to debug TACACS+ accounting issues, not all TACACS+ users.|
|/etc/audit/audit.rules||This is the audit rules file generated when |
You can edit the
/etc/pam.d/common-* files manually. However, if you run
pam-auth-update again after making the changes, the update fails. Only perform configuration in
/usr/share/pam-configs/tacplus, then run
TACACS+ Authentication (login)
The initial authentication configuration is done through the PAM modules and an updated version of the
libpam-tacplus package. When the package is installed, the PAM configuration is updated in
/etc/pam.d with the
pam-auth-update command. If you have made changes to your PAM configuration, you need to integrate these changes yourself. If you are also using LDAP with the
libpam-ldap package, you might need to edit the PAM configuration to ensure the LDAP and TACACS ordering that you prefer. The
libpam-tacplus are configured to skip over rules and the values in the
success=2 might require adjustments to skip over LDAP rules.
A user privilege level is determined by the TACACS+ privilege attribute
priv_lvl for the user that is returned by the TACACS+ server during the user authorization exchange. The client accepts the attribute in either the mandatory or optional forms and also accepts
priv-lvl as the attribute name. The attribute value must be a numeric string in the range 0 to 15, with 15 the most privileged level.
By default, TACACS+ users at privilege levels other than 15 are not allowed to run
sudo commands and are limited to commands that can be run with standard Linux user permissions.
TACACS+ accounting is implemented with the
audisp module, with an additional plugin for
audisp. The plugin maps the auid in the accounting record to a TACACS login, based on the
audisp module requires
libnss_tacplus and uses the
libtacplus_map.so library interfaces as part of the modified
Communication with the TACACS+ servers is done with the
libsimple-tacact1 library, through
dlopen(). A maximum of 240 bytes of command name and arguments are sent in the accounting record, due to the TACACS+ field length limitation of 255 bytes.
All Linux commands result in an accounting record, including commands run as part of the login process or as a sub-processes of other commands. This can sometimes generate a large number of accounting records.
Configure the IP address and encryption key of the server in the
/etc/tacplus_servers file. Minimal configuration to
audisp is necessary to enable the audit records necessary for accounting. These records are installed as part of the package.
audisp-tacplus installs the audit rules for command accounting. Modifying the configuration files is not usually necessary. However, when a management VRF is configured, the accounting configuration does need special modification because the
auditd service starts prior to networking. It is necessary to add the vrf parameter and to signal the
audisp-tacplus process to reread the configuration. The example below shows that the management VRF is named mgmt. You can place the vrf parameter in either the
/etc/tacplus_servers file or in the
After editing the configuration file, send the HUP signal
killall -HUP audisp-tacplus to notify the accounting process to reread the file.
sudo commands run by TACACS+ users generate accounting records against the original TACACS+ login name.
For more information, refer to the
auditd.8 man pages.
Configuring NCLU for TACACS+ Users
When you install or upgrade TACACS+ packages, mapped user accounts are created automatically. All tacacs0 through tacacs15 users are added to the netshow group.
In order for any TACACS+ users to execute
net del, and
net commit commands and to restart services with NCLU, you need to add those users to the
users_with_edit variable in the
/etc/netd.conf file. Cumulus Networks recommends you add the tacacs15 user and, depending upon your policies, other users (tacacs1 through tacacs14) to this variable.
To give a TACACS+ user access to the show commands, add the tacacs group to the
Do not add the tacacs group to the
groups_with_edit variable; this is dangerous and can potentially enable any user to log into the switch as the root user.
To add the users, edit the
After you save and exit the
netd.conf file, restart the
netd service. Run:
TACACS+ Per-command Authorization
tacplus-auth command handles the per-command authorization. To make this an enforced authorization, you must change the TACACS+ login to use a restricted shell, with a very limited executable search path. Otherwise, the user can bypass the authorization. The
tacplus-restrict utility simplifies the setup of the restricted environment. The example below initializes the environment for the tacacs0 user account. This is the account used for TACACS+ users at privilege level
If the user/command combination is not authorized by the TACACS+ server, a message similar to the following displays:
|-i||Initializes the environment. You only need to issue this option once per username.|
|-a||You can invoke the utility with the |
Re-initializes the environment. If you need to restart, issue the
As part of the initialization:
For example, if you want to allow the user to be able to run the
ip commands (if authorized by the TACACS+ server), use the command:
After running this command, examine the
Other than shell built-ins, the only two commands the privilege level 0 TACACS users can run are the
If you mistakenly add potential commands with the
-a option, you can remove them. The example below shows how to remove the
You can remove all commands as follows:
man command on the switch for more information on
When used with
pam_tacplus, TACACS+ authenticated users can log in without a local account on the system using the NSS plugin that comes with the
tacplus_nss package. The plugin uses the mapped
tacplus information if the user is not found in the local password file, provides the
getpwuid()entry point,s and uses the TACACS+ authentication functions.
The plugin asks the TACACS+ server if the user is known, and then for relevant attributes to determine the privilege level of the user. When the
libnss_tacplus package is installed,
nsswitch.conf is modified to set
tacplus as the first lookup method for
passwd. If the order is changed, lookups return the local accounts, such as
If the user is not found, a mapped lookup is performed using the
exported functions. The privilege level is appended to
tacacs and the lookup searches for the name in the local password file. For example, privilege level 15 searches for the tacacs15 user. If the user is found, the password structure is filled in with information for the user.
If the user is not found, the privilege level is decremented and checked again until privilege level 0 (user t
acacs0) is reached. This allows use of only the two local users
tacacs15, if minimal configuration is desired.
TACACS Configuration Parameters
The recognized configuration options are the same as the
libpam_tacplus command line arguments; however, not all
pam_tacplus options are supported. These configuration parameters are documented in the
tacplus_servers.5 man page, which is part of the
The table below describes the configuration options available:
The output debugging information through
Debugging is heavy, including passwords. Do not leave debugging enabled on a production switch after you have completed troubleshooting.
|secret=STRING||The secret key used to encrypt and decrypt packets sent to and received from the server. You can specify the secret key more than once in any order with respect to the server= parameter. When fewer secret= parameters are specified, the last secret given is used for the remaining servers. Only use this parameter in files such as |
Adds a TACACS+ server to the servers list. Servers are queried in turn until a match is found, or no servers remain in the list. Can be specified up to 7 times. An IP address can be optionally followed by a port number, preceded by a ":". The default port is 49.
When sending accounting records, the record is sent to all servers in the list if
|timeout=SECONDS||TACACS+ server(s) communication timeout. The default value is 5 seconds.|
TACACS+ authentication service (pap, chap, or login). The default value is pap.
This is not enabled by default. When enabled, a separate home directory for each TACACS+ user is created when the TACACS+ user first logs in. By default, the home directory in the mapping accounts in
This option is not honored for accounts with restricted shells when per-command authorization is enabled.
Configuration option for
|timeout=SECS||Sets the timeout in seconds for connections to each TACACS+ server. The default is 10 seconds for all lookups except that NSS lookups use a 5 second timeout.|
If the management network is in a VRF, set this variable to the VRF name. This would usually be "mgmt". When this variable is set, the connection to the TACACS+ accounting servers is made through the named VRF.
TACACS+ accounting and authorization service. Examples include shell, pap, raccess, ppp, and slip.
The default value is shell.
TACACS+ protocol field. This option is use dependent.
PAM uses the SSH protocol.
Removing the TACACS+ Client Packages
To remove all of the TACACS+ client packages, use the following commands:
To remove the TACACS+ client configuration files as well as the packages (recommended), use this command:
Debugging Basic Server Connectivity or NSS Issues
You can use the
getent command to determine if TACACS+ is configured correctly and if the local password is stored in the configuration files. In the example commands below, the cumulus user represents the local user, while cumulusTAC represents the TACACS user.
To look up the username within all NSS methods:
To look up the user within the local database only:
To look up the user within the TACACS+ database only:
If TACACS does not appear to be working correctly, debug the following configuration files by adding the debug=1 parameter to one or more of these files:
You can also add debug=1 to individual
pam_tacplus lines in
All log messages are stored in
Incorrect Shared Key
The TACACS client on the switch and the TACACS server should have the same shared secret key. If this key is incorrect, the following message is printed to
Debugging Issues with Per-command Authorization
To debug TACACS user command authorization, have the TACACS+ user enter the following command at a shell prompt, then try the command again:
When this debugging is enabled, additional information is shown for the command authorization conversation with the TACACS+ server:
To disable debugging:
Debug Issues with Accounting Records
If you have added or deleted TACACS+ servers from the configuration files, make sure you notify the
audisp plugin with this command:
If accounting records are still not being sent, add debug=1 to the
/etc/audisp/audisp-tac_plus.conf file, then issue the command above to notify the plugin. Ask the TACACS+ user to run a command and examine the end of
/var/log/syslog for messages from the plugin. You can also check the auditing log file
/var/log/audit/audit.log to be sure the auditing records are being written. If they are not, restart the audit daemon with:
TACACS Component Software Descriptions
The following table describes the different pieces of software involved with delivering TACACS.
|audisp-tacplus_1.0.0-1-cl3u3||This package uses auditing data from |
|libtac2_1.4.0-cl3u2||Basic TACACS+ server utility and communications routines.|
|libnss-tacplus_1.0.1-cl3u3||Provides an interface between |
|tacplus-auth-1.0.0-cl3u1||This package includes the |
|libpam-tacplus_1.4.0-1-cl3u2||A modified version of the standard Debian package.|
|libtacplus-map1_1.0.0-cl3u2||The mapping functionality between local and TACACS+ users on the server. Sets the immutable |
|libsimple-tacacct1_1.0.0-cl3u2||Provides an interface for programs to send accounting records to the TACACS+ server. Used by |
|Provides the |
TACACS+ Client Is only Supported through the Management Interface
The TACACS+ client is only supported through the management interface on the switch: eth0, eth1, or the VRF management interface. The TACACS+ client is not supported through bonds, switch virtual interfaces (SVIs), or switch port interfaces (swp).
Multiple TACACS+ Users
If two or more TACACS+ users are logged in simultaneously with the same privilege level, while the accounting records are maintained correctly, a lookup on either name will match both users, while a UID lookup will only return the user that logged in first.
This means that any processes run by either user will be attributed to both, and all files created by either user will be attributed to the first name matched. This is similar to adding two local users to the password file with the same UID and GID, and is an inherent limitation of using the UID for the base user from the password file.
The current algorithm returns the first name matching the UID from the mapping file; this can be the first or the second user that logged in.
To work around this issue, you can use the switch audit log or the TACACS server accounting logs to determine which processes and files are created by each user.
For commands that do not execute other commands (for example, changes to configurations in an editor, or actions with tools like
vtysh), no additional accounting is done.
Per-command authorization is implemented at the most basic level (commands are permitted or denied based on the standard Linux user permissions for the local TACACS users and only privilege level 15 users can run
sudocommands by default).
auditd system does not always generate audit events for processes when terminated with a signal (with the
kill system call or internal errors such as SIGSEGV). As a result, processes that exit on a signal that is not caught and handled, might not generate a STOP accounting record.
Issues with deluser Command
TACACS+ and other non-local users that run the
deluser command with the
--remove-home option will see an error about not finding the user in
However, the command does remove the home directory. The user can still log in on that account, but will not have a valid home directory. This is a known upstream issue with the
deluser command for all non-local users.
Only use the
--remove-home option when the
user_homedir=1 configuration command is in use.