id = spawnd {
background = no
# single process = yes
listen { port = 49 }
spawn {
instances min = 1
instances max = 32
}
}
id = tac_plus-ng {
mavis module = external {
setenv SHADOWFILE = /tmp/shadow
# setenv MKPASSWD = /usr/bin/mkpasswd
# setenv MKPASSWDMETHOD = sha-512
}
login backend = mavis chpass
log authzlog {
destination = /var/log/tac_plus/authz/%Y/%m/%d.log
separator = ","
}
log authclog {
destination = /var/log/tac_plus/authc/%Y/%m/%d.log
separator = ","
}
log acctlog {
destination = /var/log/tac_plus/acct/%Y/%m/%d.log
separator = ","
}
accounting log = acctlog
authentication log = authclog
authorization log = authzlog
acl password-compliance {
if (password =~ /^....../)
permit
deny
}
# password acl = password-compliance
# acl test_acl {
# deny
# }
# # permit
# }
device juniper_devices {
device junos1 {
address = 10.99.95.1/32
}
device junos30 {
address = 10.99.95.30/32
}
single-connection = no
# password max-attempts = 1
key = demo
welcome banner = "WELCOME TO JUNIPER DEVICE\n"
motd banner = "YOU ARE IN MY EYES\n"
reject banner = "YOU ARE BLOCKED\n"
failed authentication banner = "FAIL AUTHENTICATION\n"
# password max-attempts = 1
}
device cisco_devices {
address = 10.99.95.11/32
key = demo
enable 15 = clear admin
welcome banner = "WELCOME TO CISCO DEVICE\n"
motd banner = "YOU ARE IN MY EYES\n"
reject banner = "YOU ARE BLOCKED\n"
failed authentication banner = "FAIL AUTHENTICATION\n"
}
profile admin {
script {
if (service == junos-exec) {
# set user-permissions = "interface network view"
set local-user-name = "tac_admin"
# set deny-commands = "^(show|configure)"
permit
}
if (service == shell) {
if (cmd == "") {
set priv-lvl = 15
permit
}
permit
}
deny
}
}
profile cisco-admin {
script {
if (service == shell) {
if (cmd == "") {
set priv-lvl = 15
permit
}
permit
}
deny
}
}
user thanhpt {
password login = mavis
profile = admin
}
}
My action log:
root@Granary:/opt/tacplus-ng# ssh tha...@10.99.95.30
(tha...@10.99.95.30) WELCOME TO JUNIPER DEVICE
Password:
(tha...@10.99.95.30) Entering password change dialog
Old password:
(tha...@10.99.95.30) New password:
(tha...@10.99.95.30) Retype new password:
YOU ARE IN MY EYES
Password change was successful.
--- JUNOS 14.1R1.10 built 2014-06-07 09:37:07 UTC
thanhpt@authen> exit
Connection to 10.99.95.30 closed.
root@Granary:/opt/tacplus-ng# ssh tha...@10.99.95.30
(tha...@10.99.95.30) WELCOME TO JUNIPER DEVICE
Password:
(tha...@10.99.95.30) Entering password change dialog
Old password:
(tha...@10.99.95.30) New password:
(tha...@10.99.95.30) Retype new password:
YOU ARE BLOCKEDtac_plus-ng log:3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 ---<start packet>---
3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 key used: demo
3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 version: 192, type: 1, seq no: 6, flags: unencrypted
3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 session id: 7c2ef730, data length: 20
3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 packet body (len: 20):
3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 0000 03 01 00 0e 00 00 4e 65 77 20 70 61 73 73 77 6f ......Ne w passwo
3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 0010 72 64 3a 20 rd:
3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 AUTHEN, status=3 (AUTHEN/GETDATA) flags=0x1
3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 msg_len=14, data_len=0
3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 msg (len: 14): New password:
3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 data (len: 0):
3276: 03:30:51.519 5/7c2ef730: 10.99.95.30 ---<end packet>---
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 ---<start packet>---
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 key used: demo
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 version: 192, type: 1, seq no: 7, flags: unencrypted
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 session id: 7c2ef730, data length: 10
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 packet body [partially masked] (len: 5):
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 0000 00 05 00 00 00 2a 2a 2a 2a 2a .....*** **
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 AUTHEN/CONT user_msg_len=5, user_data_len=0
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 ---<end packet>---
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 authen: hdr->seq_no: 7
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 Writing AUTHEN/GETDATA size=39
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 ---<start packet>---
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 key used: demo
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 version: 192, type: 1, seq no: 8, flags: unencrypted
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 session id: 7c2ef730, data length: 27
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 packet body (len: 27):
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 0000 03 01 00 15 00 00 52 65 74 79 70 65 20 6e 65 77 ......Re type new
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 0010 20 70 61 73 73 77 6f 72 64 3a 20 passwor d:
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 AUTHEN, status=3 (AUTHEN/GETDATA) flags=0x1
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 msg_len=21, data_len=0
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 msg (len: 21): Retype new password:
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 data (len: 0):
3276: 03:30:56.133 5/7c2ef730: 10.99.95.30 ---<end packet>---
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 ---<start packet>---
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 key used: demo
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 version: 192, type: 1, seq no: 9, flags: unencrypted
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 session id: 7c2ef730, data length: 10
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 packet body [partially masked] (len: 5):
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 0000 00 05 00 00 00 2a 2a 2a 2a 2a .....*** **
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 AUTHEN/CONT user_msg_len=5, user_data_len=0
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 ---<end packet>---
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 authen: hdr->seq_no: 9
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 looking for user thanhpt realm default
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 user lookup succeded
3276: 03:30:57.687 5/7c2ef730: 10.99.95.30 password change for 'thanhpt' from 10.98.13.98 failed
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 Writing AUTHEN/FAIL size=34
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 ---<start packet>---
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 key used: demo
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 version: 192, type: 1, seq no: 10, flags: unencrypted
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 session id: 7c2ef730, data length: 22
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 packet body (len: 22):
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 0000 02 00 00 10 00 00 59 4f 55 20 41 52 45 20 42 4c ......YO U ARE BL
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 0010 4f 43 4b 45 44 0a OCKED.
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 AUTHEN, status=2 (AUTHEN/FAIL) flags=0x0
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 msg_len=16, data_len=0
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 msg (len: 16): YOU ARE BLOCKED\n
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 data (len: 0):
3276: 03:30:58.689 5/7c2ef730: 10.99.95.30 ---<end packet>---
3276: 03:30:58.698 6/00000000: 10.99.95.30 connection request from 10.99.95.30 (realm: default)
3276: 03:30:58.698 6/b368102d: 10.99.95.30 New tacacs session