<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>TACACS+ | A DevOps Blog</title><link>https://blog.bsdserver.nl/tag/tacacs/</link><description>Hands-on DevOps and homelab content: Kubernetes clusters, self-hosted services, CI/CD pipelines and infrastructure as code, by Patrick de Ruiter of We Build Your Cloud.</description><language>en</language><image><url>https://blog.bsdserver.nl/images/app-icon.svg</url><title>A DevOps Blog</title><link>https://blog.bsdserver.nl/</link></image><lastBuildDate>Fri, 20 Nov 2026 09:00:00 +0100</lastBuildDate><atom:link href="https://blog.bsdserver.nl/tag/tacacs/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title>Setting Up TACACS+ on OpenBSD 7.9 for Legacy Network Devices</title><link>https://blog.bsdserver.nl/setting-up-tacacs-on-openbsd-7-4-for-legacy-network-devices/</link><guid isPermaLink="false">693b516f79eb54000160a499</guid><dc:creator>Patrick de Ruiter</dc:creator><pubDate>Thu, 11 Dec 2025 23:19:11 +0000</pubDate><description>TACACS+ (Terminal Access Controller Access-Control System Plus) is a protocol that provides authentication, authorization, and accounting (AAA) services.</description><category>OpenBSD</category><category>TACACS+</category><category>Security</category><category>Networking</category><media:content url="https://blog.bsdserver.nl/content/images/2026/01/openbsd-tacacs.png" medium="image"/><content:encoded><![CDATA[<p>TACACS+ (Terminal Access Controller Access-Control System Plus) is a protocol that provides authentication, authorization, and accounting (AAA) services. It is commonly used to control access to network devices from one central place, instead of a local account on every switch.</p>
<p>This post installs the tac_plus TACACS+ server on OpenBSD, restricted to a management network. OpenBSD&rsquo;s security-oriented approach gives a stable environment for a protocol that itself is weak.</p>
<p><strong>Critical Security Warning:</strong> TACACS+ is <strong>horribly insecure</strong> and should only be used when no better alternatives, such as <strong>RADIUS with RadSec</strong>, are available. It transmits authentication information in a way that is susceptible to interception, making it unsuitable for modern secure environments. Additionally, the simplest tac_plus configuration (<code>global = cleartext</code>, used below) <strong>stores passwords in clear text</strong>, which poses a significant security risk. tac_plus can store bcrypt hashes instead (<code>login = des</code> and <code>pap = des</code>, hashes generated with <code>encrypt(1)</code>), but the <code>global</code> keyword only accepts cleartext.</p>
<p><strong>TACACS+ should only be used in a network segment that has no direct internet access and in a VLAN that is exclusively dedicated to management purposes.</strong> It should only be deployed when there is <strong>no other way</strong> to centrally manage devices.</p>
<h2 id="why-tacacs">Why TACACS+? <a class="anchor" data-pagefind-ignore href="#why-tacacs" aria-label="Link to this section">#</a></h2>
<ul>
<li><strong>Central logins</strong> - One user list for all devices, instead of local accounts per switch.</li>
<li><strong>Accounting</strong> - A log of who did what on which device.</li>
<li><strong>Legacy support</strong> - Old devices that only speak TACACS+, or handle RADIUS badly.</li>
</ul>
<h3 id="when-to-use-it">When to use it <a class="anchor" data-pagefind-ignore href="#when-to-use-it" aria-label="Link to this section">#</a></h3>
<ul>
<li><strong>Use it</strong> only for legacy devices without a better option. I use TACACS+ for authenticating to some old Zyxel switches that do not work well with RADIUS, a necessary compromise in specific legacy environments.</li>
<li><strong>Skip it</strong> for anything that supports RADIUS with RadSec or another modern mechanism.</li>
</ul>
<h2 id="how-it-works">How It Works <a class="anchor" data-pagefind-ignore href="#how-it-works" aria-label="Link to this section">#</a></h2>
<table>
	<thead>
			<tr>
					<th>Component</th>
					<th>Runs on</th>
					<th>Job</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>tac_plus</td>
					<td>OpenBSD server, management VLAN</td>
					<td>Checks logins against <code>/etc/tac_plus.conf</code>, writes accounting records.</td>
			</tr>
			<tr>
					<td>TACACS+ client</td>
					<td>Each network device</td>
					<td>Sends login attempts to tac_plus on TCP port 49, using the shared key.</td>
			</tr>
			<tr>
					<td>newsyslog</td>
					<td>OpenBSD server</td>
					<td>Rotates the tac_plus log files.</td>
			</tr>
	</tbody>
</table>
<p>The flow: an admin logs in on a switch → the switch sends the credentials to tac_plus on port 49 → tac_plus checks the user → accept or reject → the session is logged to the accounting file and syslog.</p>
<h2 id="step-1-install-tacacs-on-openbsd">Step 1: Install TACACS+ on OpenBSD <a class="anchor" data-pagefind-ignore href="#step-1-install-tacacs-on-openbsd" aria-label="Link to this section">#</a></h2>
<p>The server is a package from the OpenBSD ports tree:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">pkg_add tacacs+
</span></span></code></pre></div><p>This installs tac_plus F4.0.4.28 (package <code>tacacs+-4.0.4.28p4v0</code>, with Python 3 as a dependency), creates the <code>_tacacs</code> user and group, and installs <code>/etc/rc.d/tac_plus</code> plus a sample <code>/etc/tac_plus.conf</code>. These steps were verified on OpenBSD 7.9.</p>
<h2 id="step-2-configure-log-rotation">Step 2: Configure Log Rotation <a class="anchor" data-pagefind-ignore href="#step-2-configure-log-rotation" aria-label="Link to this section">#</a></h2>
<p>Accounting logs grow with every login and command. Add the following entries to <code>/etc/newsyslog.conf</code> so they are rotated:</p>
<pre tabindex="0"><code>/var/log/tac_plus/tac.acct        _tacacs:_tacacs 644  7     250  *     Z
/var/log/tac_plus/tac.log         _tacacs:_tacacs 644  7     250  *     Z
/var/log/tac_plus/tacwho.log      _tacacs:_tacacs 644  7     250  *     Z
</code></pre><ul>
<li><code>_tacacs:_tacacs 644</code>: owner and mode of the new log file, so tac_plus can keep writing.</li>
<li><code>7</code>: number of old files to keep.</li>
<li><code>250</code>: rotate when the file reaches 250 KB.</li>
<li><code>*</code>: no time-based rotation; size only.</li>
<li><code>Z</code>: compress rotated files.</li>
</ul>
<p>newsyslog runs from cron and rereads <code>/etc/newsyslog.conf</code> on every run, so nothing needs to be restarted. Check the entries with a dry run:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">newsyslog -n -v <span class="p">|</span> grep tac_plus
</span></span></code></pre></div><p>newsyslog skips files that do not exist yet, so on a fresh install this prints nothing. After the first login <code>tac.acct</code> shows up (<code>/var/log/tac_plus/tac.acct &lt;7Z&gt;: size (KB): ...</code>); a malformed line is reported as an error instead.</p>
<p>Note that tac_plus only writes <code>tac.log</code> when started with <code>-d</code>; its normal messages go to syslog (<code>/var/log/daemon</code>).</p>
<h2 id="step-3-configure-tacacs">Step 3: Configure TACACS+ <a class="anchor" data-pagefind-ignore href="#step-3-configure-tacacs" aria-label="Link to this section">#</a></h2>
<p><code>/etc/tac_plus.conf</code> holds the shared key, where accounting goes, and the users. Replace the sample with:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="nv">key</span> <span class="o">=</span> <span class="s2">&#34;your_shared_secret_here&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Default accounting file</span>
</span></span><span class="line"><span class="cl">accounting <span class="nv">file</span> <span class="o">=</span> /var/log/tac_plus/tac.acct
</span></span><span class="line"><span class="cl">accounting syslog
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># User definition</span>
</span></span><span class="line"><span class="cl"><span class="nv">user</span> <span class="o">=</span> administrator <span class="o">{</span>
</span></span><span class="line"><span class="cl">  default <span class="nv">service</span> <span class="o">=</span> permit
</span></span><span class="line"><span class="cl">  <span class="nv">global</span> <span class="o">=</span> cleartext your_password_here
</span></span><span class="line"><span class="cl">  <span class="nv">service</span> <span class="o">=</span> <span class="nb">exec</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl">    priv-lvl <span class="o">=</span> <span class="m">15</span>
</span></span><span class="line"><span class="cl">  <span class="o">}</span>
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span></code></pre></div><table>
	<thead>
			<tr>
					<th>Setting</th>
					<th>What it does</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><code>key</code></td>
					<td>Shared secret between tac_plus and the devices. Configure the same value on each switch.</td>
			</tr>
			<tr>
					<td><code>accounting file</code></td>
					<td>Where accounting records are written (rotated in Step 2).</td>
			</tr>
			<tr>
					<td><code>accounting syslog</code></td>
					<td>Also send accounting records to syslog.</td>
			</tr>
			<tr>
					<td><code>user = ... { global = cleartext ... }</code></td>
					<td>A login and its password, for all services. Use <code>login = des</code> / <code>pap = des</code> with a hash to avoid cleartext.</td>
			</tr>
			<tr>
					<td><code>default service = permit</code></td>
					<td>Authorizes every service and command for this user. Must be the first line in the block.</td>
			</tr>
			<tr>
					<td><code>service = exec { priv-lvl = 15 }</code></td>
					<td>Gives the user privilege level 15 (full admin) on a device that asks for exec authorization.</td>
			</tr>
	</tbody>
</table>
<p>tac_plus denies authorization for anything that is not explicitly permitted. Without the last two settings the password check passes, but a switch that also asks for authorization refuses the shell.</p>
<p>Change the shared secret and user password to secure values. <code>-P</code> only parses the file and prints it, so you can check it before starting:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">tac_plus -C /etc/tac_plus.conf -P
</span></span></code></pre></div><h2 id="step-4-enable-tacacs-and-configure-the-listening-interface">Step 4: Enable TACACS+ and Configure the Listening Interface <a class="anchor" data-pagefind-ignore href="#step-4-enable-tacacs-and-configure-the-listening-interface" aria-label="Link to this section">#</a></h2>
<p>By default tac_plus listens on all addresses. <code>-B</code> binds it to the management address only.</p>
<p>Don&rsquo;t edit <code>/etc/rc.d/tac_plus</code> itself (package updates overwrite it and <code>pkg_check</code> flags it as modified); use <code>rcctl</code>, which stores the flags in <code>/etc/rc.conf.local</code>. Enable the service first: for a package service <code>rcctl set</code> refuses with &ldquo;rcctl: tac_plus is not enabled&rdquo;.</p>
<p>The flags replace the script&rsquo;s defaults, so repeat <code>-C</code>, <code>-Q</code> and <code>-U</code>; without <code>-C</code> tac_plus exits with &ldquo;no config file specified&rdquo;:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rcctl <span class="nb">enable</span> tac_plus
</span></span><span class="line"><span class="cl">rcctl <span class="nb">set</span> tac_plus flags -C /etc/tac_plus.conf -Q _tacacs -U _tacacs -B 192.168.2.254
</span></span></code></pre></div><table>
	<thead>
			<tr>
					<th>Flag</th>
					<th>What it does</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><code>-C /etc/tac_plus.conf</code></td>
					<td>The configuration file. Required.</td>
			</tr>
			<tr>
					<td><code>-Q _tacacs</code> / <code>-U _tacacs</code></td>
					<td>Group and user tac_plus runs as, instead of root.</td>
			</tr>
			<tr>
					<td><code>-B 192.168.2.254</code></td>
					<td>The address to listen on. Use your management address.</td>
			</tr>
	</tbody>
</table>
<h2 id="step-5-start-tacacs">Step 5: Start TACACS+ <a class="anchor" data-pagefind-ignore href="#step-5-start-tacacs" aria-label="Link to this section">#</a></h2>
<p>The service now starts at boot; start it now as well:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rcctl start tac_plus
</span></span></code></pre></div><p>Verify the service:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rcctl check tac_plus
</span></span><span class="line"><span class="cl">netstat -an -f inet -p tcp <span class="p">|</span> grep <span class="s1">&#39;\.49 &#39;</span>
</span></span></code></pre></div><p>The listener should show your management address (for example <code>192.168.2.254.49</code>), not <code>*.49</code>.</p>
<h2 id="troubleshooting">Troubleshooting <a class="anchor" data-pagefind-ignore href="#troubleshooting" aria-label="Link to this section">#</a></h2>
<table>
	<thead>
			<tr>
					<th>Symptom</th>
					<th>Cause / fix</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><code>rcctl: tac_plus is not enabled</code></td>
					<td>Run <code>rcctl enable tac_plus</code> before <code>rcctl set</code>.</td>
			</tr>
			<tr>
					<td>tac_plus exits with &ldquo;no config file specified&rdquo;</td>
					<td>The <code>rcctl</code> flags lack <code>-C /etc/tac_plus.conf</code>.</td>
			</tr>
			<tr>
					<td>tac_plus exits with &ldquo;Unrecognised keyword default for user&rdquo;</td>
					<td><code>default service</code> is not the first line in the <code>user</code> block.</td>
			</tr>
			<tr>
					<td>Login accepted, but the switch refuses the shell</td>
					<td>The device asks for authorization; add <code>default service = permit</code> and <code>service = exec</code>.</td>
			</tr>
			<tr>
					<td>Listener shows <code>*.49</code></td>
					<td><code>-B</code> is not in the flags. Check <code>rcctl get tac_plus flags</code>.</td>
			</tr>
			<tr>
					<td><code>tac.log</code> stays empty</td>
					<td>Normal: without <code>-d</code> messages go to <code>/var/log/daemon</code>.</td>
			</tr>
	</tbody>
</table>
<h2 id="security-considerations">Security Considerations <a class="anchor" data-pagefind-ignore href="#security-considerations" aria-label="Link to this section">#</a></h2>
<ul>
<li><strong>Restrict access</strong>: Use firewall rules to allow only trusted devices to reach port 49.</li>
<li><strong>Use encryption</strong>: Implement encrypted communication channels where possible.</li>
<li><strong>Rotate credentials</strong>: Regularly update shared secrets and user passwords.</li>
<li><strong>Monitor logs</strong>: Periodically review logs for suspicious activities.</li>
</ul>
<h2 id="conclusion">Conclusion <a class="anchor" data-pagefind-ignore href="#conclusion" aria-label="Link to this section">#</a></h2>
<p>You now have a TACACS+ server on OpenBSD, listening only on the management network. However, <strong>TACACS+ is fundamentally insecure</strong> and should only be used when no better alternatives are available.</p>
<p><strong>Key Takeaways:</strong></p>
<ul>
<li>TACACS+ is commonly configured with clear-text passwords (as in this guide), making it <strong>extremely insecure</strong>.</li>
<li>It should <strong>only</strong> be deployed in a <strong>segmented network</strong> with no direct internet access.</li>
<li>It should only be used when no other option exists for centrally managing legacy devices.</li>
</ul>
<p><strong>If possible, consider migrating to a more secure authentication mechanism to better protect your network environment.</strong></p>
]]></content:encoded></item></channel></rss>