Track2Agenda: tacacs-lab.page

File tacacs-lab.page, 2.1 KB (added by pokui, 6 years ago)

tacacs lab (TXT)

Line 
1% Security workshop
2% Tacacs lab
3
4\pagebreak
5
6# getting tacacs configured
7
8
9~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10$ sudo apt-get install tacacs+
11$ sudo groupadd -r cisco
12$ sudo vi /etc/tacacs+/tac_plus.conf
13~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14
15### change the following settings
16
171. we want to set the password for routers who want to use our service to TacacsPassword
181. We also want to limit access for users based on groups. For this example we will use settings in tac_plus.conf
19
20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21# change this line
22
23key = TacacsPassword
24
25# ... then at the end of the file .... add:
26
27group = netops {
28        default service = permit
29        login = file /etc/passwd
30        enable = file /etc/passwd
31        service = exec {
32                priv-lvl = 15
33                }
34}
35
36#
37# "level 2" users who cannot "debug" or "config"
38#
39group = l2_tacacs_users {
40        default service = permit
41        login = file /etc/passwd
42        enable = file /etc/passwd
43        service = exec {
44                priv-lvl = 15
45                }
46        cmd = configure {
47                deny "."
48                }
49        cmd = debug {
50                deny "."
51                }
52}
53
54user = sysadm {
55        member = netops
56}
57 
58~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59
60### restart tacacs_plus to pick up the new settings
61
62~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63$ sudo service tacacs_plus restart
64
65~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66
67# getting a cisco device to talk to your tacas
68
69~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70aaa new-model
71aaa authentication login default group tacacs+ local
72aaa authorization console
73aaa authorization exec default group tacacs+ if-authenticated
74aaa session-id common
75
76aaa accounting delay-start
77aaa accounting exec default start-stop group tacacs+
78aaa accounting commands 15 default start-stop group tacacs+
79
80
81tacacs-server host 10.10.9.1
82tacacs-server key TacacsPassword
83
84~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85
86### Now you can verify accounting
87
88~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89Router#show accounting
90~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~