# yum install gcc # yum install perl-LDAP # yum install bind-utils
# yum install wget # wget http://www.pro-bono-publico.de/projects/src/DEVEL.tar.bz2 # tar xvfj ./DEVEL.tar.bz2 # cd ./PROJECTS # ./configure # make # make install
# mkdir /var/log/tac_plus # mkdir /var/log/tac_plus/access # mkdir /var/log/tac_plus/acct # chmod 760 -R /var/log/tac_plus/
# cp /root/PROJECTS/tac_plus/extra/etc_init.d_tac_plus /etc/init.d/tac_plus # chmod 755 /etc/init.d/tac_plus # chkconfig --add tac_plus # chkconfig --level 2345 tac_plus on
# chkconfig --list | grep tac_plus
# cp /root/PROJECTS/tac_plus/extra/tac_plus.cfg-ads /usr/local/etc/tac_plus.cfg # chmod 660 /usr/local/etc/tac_plus.cfg
#!/usr/local/sbin/tac_plus id = spawnd { listen = { port = 49 } #, TACACS spawn = { instances min = 1 instances max = 10 } background = yes } id = tac_plus { # access log = ">/var/log/tac_plus/access/%Y%m%d.log" accounting log = ">/var/log/tac_plus/acct/%Y%m%d.log" # Active Directory mavis module = external { setenv LDAP_SERVER_TYPE = "microsoft" setenv LDAP_HOSTS = "ldaps://domain.name:636" # DNS- ( nslookup). IP setenv LDAP_SCOPE = sub setenv LDAP_BASE = "dc=domain,dc=name" # setenv LDAP_FILTER = "(&(objectclass=user)(sAMAccountName=%s))" setenv LDAP_USER = "aduser@domain.name" # AD setenv LDAP_PASSWD = "passw0rd" # #setenv AD_GROUP_PREFIX = tacacs #setenv REQUIRE_TACACS_GROUP_PREFIX = 1 #setenv USE_TLS = 0 setenv FLAG_USE_MEMBEROF = 1 exec = /usr/local/lib/mavis/mavis_tacplus_ldap.pl } login backend = mavis user backend = mavis #pap backend = mavis host = world { address = ::/0 welcome banner = "" #Crypt password generate by "openssl passwd -1 clear_text_password" enable 15 = crypt $1$eqIkg6p0$jzhK5. key = "TACACSPASSWORD" # TACACS- } # group = ADMIN { message = "[Admin privileges]" default service = permit service = shell { default command = permit default attribute = permit set priv-lvl = 15 } } # group = VOIP { message = "[VoIP-admin privileges]" default service = permit service = shell { default command = permit default attribute = permit set priv-lvl = 15 cmd = interface { permit "Lo*" permit "Se*" deny .* } cmd = aaa { deny .* } cmd = username { deny .* } cmd = line { deny .* } cmd = delete { deny .* } #cmd = reload { deny .* } cmd = boot { deny .* } cmd = enable { deny .* } cmd = archive { deny .* } cmd = router { deny .* } cmd = ip { permit "address *" deny .* } cmd = tacacs-server { deny .* } cmd = radius-server { deny .* } cmd = privilege { deny .* } cmd = erase { deny .* } cmd = write { permit "memory" deny .* } cmd = format { deny .* } } } }
# /usr/local/sbin/tac_plus -P /usr/local/etc/tac_plus.cfg
# service tac_plus start # service tac_plus stop # service tac_plus restart
tacacs server TACSRV1 !IP- tacacs- address ipv4 172.16.2.2 ! , key TACACSPASSWORD timeout 2 ! aaa new-model aaa group server tacacs+ TACSERVICE server name TACSRV1 aaa authentication login default group TACSERVICE local aaa authentication login CONSOLE local aaa authentication enable default group TACSERVICE enable aaa authorization config-commands aaa authorization exec default group TACSERVICE local aaa authorization exec CONSOLE local aaa authorization commands 15 default group TACSERVICE local aaa accounting commands 15 default start-stop group TACSERVICE ! line con 0 login authentication CONSOLE line vty 0 15
# env LDAP_HOSTS="172.16.1.1" LDAP_SERVER_TYPE="microsoft" /usr/local/lib/mavis/mavis_tacplus_ldap.pl 2. TACACS - LDAP. RESULT - ACK. , AD. <source lang="bash"> # /usr/local/bin/mavistest /usr/local/etc/tac_plus.cfg tac_plus TACPLUS <login> <password>
# netstat -nlp | grep tac_plus
# tcpdump -nn port 49
# /usr/local/sbin/tac_plus -d 4088 -fp /var/run/tac_plus.pid /usr/local/etc/tac_plus.cfg
Source: https://habr.com/ru/post/217669/
All Articles