#!/usr/local/sbin/tac_plusid = spawnd { listen = { port = 49 } spawn = { instances min = 1 instances max = 10 } background = yes}
id = tac_plus { authentication log = /var/log/tac_plus/authentication.log authorization log = /var/log/tac_plus/authorization.log accounting log = /var/log/tac_plus/accounting.log authorization log group = yes
mavis module = external { setenv LDAP_SERVER_TYPE = "microsoft" setenv LDAP_HOSTS = "WWW.XXX.YYY.ZZZ" setenv LDAP_BASE = "OU=XXXX,DC=mydomain,DC=prv" setenv LDAP_USER = ldap...@mydomain.prv setenv LDAP_PASSWD = ldappassword setenv AD_GROUP_PREFIX = tacacs setenv REQUIRE_AD_GROUP_PREFIX = 1 exec = /usr/local/lib/mavis/mavis_tacplus_ldap.pl }
login backend = mavis user backend = mavis pap backend = mavis
host = world { address = 0.0.0.0/0 key = "" }
group = admin { default service = permit service = shell { default command = permit default attribute = permit set priv-lvl = 15 } }
group = guest { default service = permit enable = deny service = shell { default command = permit default attribute = permit set priv-lvl = 1 } }
user = admin { password = clear adminpassword member = admin }
user = readonly { password = clear anotherpassword member = guest }}aaa new-modelaaa authentication login telnet group tacacs+ localaaa authentication login console group tacacs+ localaaa authentication enable default group tacacs+ enableaaa authorization exec default group tacacs+ if-authenticatedaaa accounting update newinfoaaa accounting exec default start-stop group tacacs+!
tacacs-server host WWW.XXX.YYY.ZZZno tacacs-server directed-request!
line con 0 login authentication consoleline vty 0 4 login authentication telnetline vty 5 15 login authentication telnet!tacacs-server key MYKEY13w3d: TAC+: send AUTHEN/START packet ver=192 id=183493086013w3d: TAC+: Using default tacacs server-group "tacacs+" list.13w3d: TAC+: Opening TCP/IP to 172.20.45.64/49 timeout=513w3d: TAC+: Opened TCP/IP handle 0x315C7C8 to 172.20.45.64/4913w3d: TAC+: 172.20.45.64 (1834930860) AUTHEN/START/LOGIN/ASCII queued13w3d: TAC+: (1834930860) AUTHEN/START/LOGIN/ASCII processed13w3d: TAC+: received bad AUTHEN packet: length = 33, expected 10072113w3d: TAC+: Invalid AUTHEN/START/LOGIN/ASCII packet (check keys).13w3d: TAC+: Closing TCP/IP 0x315C7C8 connection to 172.20.45.64/49
please enable debugging in the daemon (e.g.: id = tac_plus { ... debug =
PACKET ...}).
tacacs-server host 172.20.45.64no tacacs-server directed-requesttacacs-server key 7 15190E15
host = world { address = 0.0.0.0/0 key = "key"}Mar 21 09:12:09 ciscolog tac_plus[15721]: 7/7004dca5: New session
Mar 21 09:12:09 ciscolog tac_plus[15721]: 7/a5dc0470: ---<start packet>---
Mar 21 09:12:09 ciscolog tac_plus[15721]: 7/a5dc0470: key used: key
Mar 21 09:12:09 ciscolog tac_plus[15721]: 7/a5dc0470: version: 192, type: 1, seq no: 1, flags: unencrypted
Mar 21 09:12:09 ciscolog tac_plus[15721]: 7/a5dc0470: session id: a5dc0470 data length: 25
Mar 21 09:12:09 ciscolog tac_plus[15721]: 7/a5dc0470: Packet malformed, skipping detailed dump.
Mar 21 09:12:09 ciscolog tac_plus[15721]: 7/a5dc0470: ---<end packet>---
Mar 21 09:12:09 ciscolog tac_plus[15721]: 7/7004dca5: Error 172.21.1.112 (null): Invalid AUTHEN/START packet
Mar 21 09:12:09 ciscolog tac_plus[15721]: Error 172.21.1.112 (null): Invalid AUTHEN/START packet
Mar 21 09:12:09 ciscolog tac_plus[15721]: 7/7004dca5: Writing AUTHEN/ERROR size=45
root@ciscolog:/usr/src/tacacs_projects# make installmake[1]: Entering directory `/usr/src/tacacs_projects/mavis'make[2]: Entering directory `/usr/src/tacacs_projects/mavis/perl'make[2]: Nothing to be done for `install'.make[2]: Leaving directory `/usr/src/tacacs_projects/mavis/perl'make[2]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/mavis'make[3]: Entering directory `/usr/src/tacacs_projects/mavis/perl'make[3]: Nothing to be done for `install'.make[3]: Leaving directory `/usr/src/tacacs_projects/mavis/perl'make[2]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/mavis'make[1]: Leaving directory `/usr/src/tacacs_projects/mavis'make[1]: Entering directory `/usr/src/tacacs_projects/spawnd'make[2]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/spawnd'make[3]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/spawnd'make[3]: Nothing to be done for `install'.make[3]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/spawnd'make[2]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/spawnd'make[2]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/spawnd'make[2]: Nothing to be done for `install'.make[2]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/spawnd'make[1]: Leaving directory `/usr/src/tacacs_projects/spawnd'make[1]: Entering directory `/usr/src/tacacs_projects/mavisd'make[2]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/mavisd'make[3]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/mavisd'make[3]: Nothing to be done for `install'.make[3]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/mavisd'make[2]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/mavisd'make[2]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/mavisd'make[2]: Nothing to be done for `install'.make[2]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/mavisd'make[1]: Leaving directory `/usr/src/tacacs_projects/mavisd'make[1]: Entering directory `/usr/src/tacacs_projects/ftpd'make[2]: Entering directory `/usr/src/tacacs_projects/ftpd/extra'make[2]: Nothing to be done for `all'.make[2]: Leaving directory `/usr/src/tacacs_projects/ftpd/extra'make[2]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/ftpd'make[3]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/ftpd'make[4]: Entering directory `/usr/src/tacacs_projects/ftpd/extra'make[4]: Nothing to be done for `install'.make[4]: Leaving directory `/usr/src/tacacs_projects/ftpd/extra'make[3]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/ftpd'make[2]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/ftpd'make[2]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/ftpd'make[3]: Entering directory `/usr/src/tacacs_projects/ftpd/extra'make[3]: Nothing to be done for `install'.make[3]: Leaving directory `/usr/src/tacacs_projects/ftpd/extra'make[2]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/ftpd'make[1]: Leaving directory `/usr/src/tacacs_projects/ftpd'make[1]: Entering directory `/usr/src/tacacs_projects/tac_plus'make[2]: Entering directory `/usr/src/tacacs_projects/tac_plus/extra'make[2]: Nothing to be done for `all'.make[2]: Leaving directory `/usr/src/tacacs_projects/tac_plus/extra'make[2]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tac_plus'make[3]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tac_plus'make[4]: Entering directory `/usr/src/tacacs_projects/tac_plus/extra'make[4]: Nothing to be done for `install'.make[4]: Leaving directory `/usr/src/tacacs_projects/tac_plus/extra'make[3]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tac_plus'make[2]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tac_plus'make[2]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tac_plus'make[3]: Entering directory `/usr/src/tacacs_projects/tac_plus/extra'make[3]: Nothing to be done for `install'.make[3]: Leaving directory `/usr/src/tacacs_projects/tac_plus/extra'make[2]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tac_plus'make[1]: Leaving directory `/usr/src/tacacs_projects/tac_plus'make[1]: Entering directory `/usr/src/tacacs_projects/tcprelay'make[2]: Entering directory `/usr/src/tacacs_projects/tcprelay/extra'make[2]: Nothing to be done for `all'.make[2]: Leaving directory `/usr/src/tacacs_projects/tcprelay/extra'make[2]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tcprelay'make[3]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tcprelay'make[4]: Entering directory `/usr/src/tacacs_projects/tcprelay/extra'make[4]: Nothing to be done for `install'.make[4]: Leaving directory `/usr/src/tacacs_projects/tcprelay/extra'make[3]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tcprelay'make[2]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tcprelay'make[2]: Entering directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tcprelay'make[3]: Entering directory `/usr/src/tacacs_projects/tcprelay/extra'make[3]: Nothing to be done for `install'.make[3]: Leaving directory `/usr/src/tacacs_projects/tcprelay/extra'make[2]: Leaving directory `/usr/src/tacacs_projects/build/linux-3.11.0-18-generic-x86_64/tcprelay'make[1]: Leaving directory `/usr/src/tacacs_projects/tcprelay'I'm afraid the Makefiles aren't sophisticated enough. You'll have to run
"make clean" first.
Mar 21 15:20:59 ciscolog tac_plus[26529]: 1/68e9a937: New session
Mar 21 15:20:59 ciscolog tac_plus[26529]: 1/37a9e968: ---<start packet>---
Mar 21 15:20:59 ciscolog tac_plus[26529]: 1/37a9e968: key used: key
Mar 21 15:20:59 ciscolog tac_plus[26529]: 1/37a9e968: version: 192, type: 1, seq no: 1, flags: unencrypted
Mar 21 15:20:59 ciscolog tac_plus[26529]: 1/37a9e968: session id: 37a9e968 data length: 25
Mar 21 15:20:59 ciscolog tac_plus[26529]: 1/37a9e968: Packet malformed, skipping detailed dump.
Mar 21 15:20:59 ciscolog tac_plus[26529]: 1/37a9e968: ---<end packet>---
Mar 21 15:20:59 ciscolog tac_plus[26529]: 1/68e9a937: Error 172.21.1.112 (null): Invalid AUTHEN/START packet
Mar 21 15:20:59 ciscolog tac_plus[26529]: Error 172.21.1.112 (null): Invalid AUTHEN/START packet
Mar 21 15:20:59 ciscolog tac_plus[26529]: 1/68e9a937: Writing AUTHEN/ERROR size=45
id = spawnd {
listen = { port = 49 }
}
id = tac_plus {
debug = PACKET
host = any { address = 0.0.0.0/0 key = cisco }
# repeat as necessary for each user
user = test { login = clear test }
}#!/usr/bin/perl
$username = 'test';
$password = 'test';
use Net::TacacsPlus::Client;
use Net::TacacsPlus::Constants;
my $tac = new Net::TacacsPlus::Client(
host => '127.0.0.1',
key => 'cisco');
if ($tac->authenticate($username, $password, TAC_PLUS_AUTHEN_TYPE_PAP)){
print "Authentication successful.\n";
} else {
print "Authentication failed: ".$tac->errmsg()."\n";
}27623: 12:05:25.420 0/00000000: Version 201403181821 initialized
27623: 12:05:31.032 0/00000000: cidr match level 0 = any
27623: 12:05:31.032 0/00000000: connection request from 127.0.0.1 (key: cisco)
27623: 12:05:31.034 0/cb0d7286: New session
27623: 12:05:31.034 0/86720dcb: ---<start packet>---
27623: 12:05:31.034 0/86720dcb: key used: cisco
27623: 12:05:31.034 0/86720dcb: version: 193, type: 1, seq no: 1, flags: unencrypted
27623: 12:05:31.034 0/86720dcb: session id: 86720dcb data length: 34
27623: 12:05:31.034 0/86720dcb: packet body (len: 34): \001\0006#¾\025ybÆ(wäæÌua\0058±Ê¥àûÊ.1>Ù\034rst
27623: 12:05:31.034 0/86720dcb: 0000 01 00 36 9c 23 be 15 79 62 c6 28 77 e4 e6 cc 92 ..6.#..y b.(w....
27623: 12:05:31.034 0/86720dcb: 0010 75 61 05 38 b1 ca a5 e0 fb ca 2e 31 3e d9 1c 72 ua.8.... ...1>..r
27623: 12:05:31.034 0/86720dcb: 0020 73 74 st
27623: 12:05:31.034 0/86720dcb: Packet malformed, skipping detailed dump.
27623: 12:05:31.034 0/86720dcb: ---<end packet>---
27623: 12:05:31.034 0/cb0d7286: 127.0.0.1 (null): Invalid AUTHEN/START packet
27623: 12:05:31.034 0/cb0d7286: Writing AUTHEN/ERROR size=45
27623: 12:05:31.034 0/86720dcb: ---<start packet>---
27623: 12:05:31.034 0/86720dcb: key used: cisco
27623: 12:05:31.034 0/86720dcb: version: 193, type: 1, seq no: 2, flags: unencrypted
27623: 12:05:31.034 0/86720dcb: session id: 86720dcb data length: 33
27623: 12:05:31.034 0/86720dcb: packet body (len: 33): \a\000\000\033\000\000Invalid AUTHEN/START packet
27623: 12:05:31.034 0/86720dcb: 0000 07 00 00 1b 00 00 49 6e 76 61 6c 69 64 20 41 55 ......In valid AU
27623: 12:05:31.034 0/86720dcb: 0010 54 48 45 4e 2f 53 54 41 52 54 20 70 61 63 6b 65 THEN/STA RT packe
27623: 12:05:31.034 0/86720dcb: 0020 74 t
27623: 12:05:31.034 0/86720dcb: AUTHEN status=7 (AUTHEN/ERROR) flags=0x0
27623: 12:05:31.034 0/86720dcb: msg_len=27, data_len=0
27623: 12:05:31.034 0/86720dcb: msg (len: 27): Invalid AUTHEN/START packet
27623: 12:05:31.034 0/86720dcb: 0000 49 6e 76 61 6c 69 64 20 41 55 54 48 45 4e 2f 53 Invalid AUTHEN/S
27623: 12:05:31.034 0/86720dcb: 0010 54 41 52 54 20 70 61 63 6b 65 74 TART pac ket
27623: 12:05:31.034 0/86720dcb: data (len: 0):
27623: 12:05:31.034 0/86720dcb: ---<end packet>---
27623: 12:06:55.857 1/00000000: cidr match level 0 = any
27623: 12:06:55.857 1/00000000: connection request from 192.168.7.98 (key: cisco)
27623: 12:06:55.858 1/664c8079: New session
27623: 12:06:55.858 1/79804c66: ---<start packet>---
27623: 12:06:55.858 1/79804c66: key used: cisco
27623: 12:06:55.858 1/79804c66: version: 192, type: 1, seq no: 1, flags: unencrypted
27623: 12:06:55.858 1/79804c66: session id: 79804c66 data length: 24
27623: 12:06:55.858 1/79804c66: packet body (len: 24): \001\001ÇMs4ü\003\023\000|<øÒ16¦9À¢Y
27623: 12:06:55.858 1/79804c66: 0000 01 01 c7 82 99 4d 73 34 fc 03 13 00 7c 3c f8 d2 .....Ms4 ....|<..
27623: 12:06:55.858 1/79804c66: 0010 31 36 a6 9f 39 c0 a2 59 16..9..Y
27623: 12:06:55.858 1/79804c66: Packet malformed, skipping detailed dump.
27623: 12:06:55.858 1/79804c66: ---<end packet>---
27623: 12:06:55.858 1/664c8079: 192.168.7.98 (null): Invalid AUTHEN/START packet
27623: 12:06:55.858 1/664c8079: Writing AUTHEN/ERROR size=45
27623: 12:06:55.858 1/79804c66: ---<start packet>---
27623: 12:06:55.858 1/79804c66: key used: cisco
27623: 12:06:55.858 1/79804c66: version: 192, type: 1, seq no: 2, flags: unencrypted
27623: 12:06:55.858 1/79804c66: session id: 79804c66 data length: 33
27623: 12:06:55.858 1/79804c66: packet body (len: 33): \a\000\000\033\000\000Invalid AUTHEN/START packet
27623: 12:06:55.858 1/79804c66: 0000 07 00 00 1b 00 00 49 6e 76 61 6c 69 64 20 41 55 ......In valid AU
27623: 12:06:55.858 1/79804c66: 0010 54 48 45 4e 2f 53 54 41 52 54 20 70 61 63 6b 65 THEN/STA RT packe
27623: 12:06:55.858 1/79804c66: 0020 74 t
27623: 12:06:55.858 1/79804c66: AUTHEN status=7 (AUTHEN/ERROR) flags=0x0
27623: 12:06:55.858 1/79804c66: msg_len=27, data_len=0
27623: 12:06:55.858 1/79804c66: msg (len: 27): Invalid AUTHEN/START packet
27623: 12:06:55.858 1/79804c66: 0000 49 6e 76 61 6c 69 64 20 41 55 54 48 45 4e 2f 53 Invalid AUTHEN/S
27623: 12:06:55.858 1/79804c66: 0010 54 41 52 54 20 70 61 63 6b 65 74 TART pac ket
27623: 12:06:55.858 1/79804c66: data (len: 0):
27623: 12:06:55.858 1/79804c66: ---<end packet>---diff -ruN PROJECTS.orig/Makefile.inc PROJECTS/Makefile.inc
--- PROJECTS.orig/Makefile.inc 2014-03-14 05:42:06.000000000 -0800
+++ PROJECTS/Makefile.inc 2014-04-22 15:47:16.222137197 -0800
@@ -69,7 +69,7 @@
endif
ifeq ($(CC_GCC),1)
- CFLAGS ?= -O -Wall -W -Wno-strict-prototypes
+ CFLAGS ?= -O0 -Wall -W -Wno-strict-prototypes
CFLAGS_PIC ?= -fPIC
LDOPT_R ?= -Wl,-rpath,I figured it out. So if I use this patch to remove the compiler optimizations:
diff -ruN PROJECTS.orig/Makefile.inc PROJECTS/Makefile.inc
--- PROJECTS.orig/Makefile.inc 2014-03-14 05:42:06.000000000 -0800
+++ PROJECTS/Makefile.inc 2014-04-22 15:47:16.222137197 -0800
@@ -69,7 +69,7 @@
endif
ifeq ($(CC_GCC),1)
- CFLAGS ?= -O -Wall -W -Wno-strict-prototypes
+ CFLAGS ?= -O0 -Wall -W -Wno-strict-prototypes
CFLAGS_PIC ?= -fPIC
LDOPT_R ?= -Wl,-rpath,
Then it works.