본문 바로가기
Technical/System

tacacs 서버 설치 방법(Rocky Linux9.5)

by 잠적준비중 2025. 8. 12.

이번 포스트에서는 tacscs 서버 설치 및 간단한 스위치 연동에 대해 다뤄 보겠습니다.


1.서버 방화벽 및 selinux 비활성화
이번 포스트에서는 원활한 테스트를 위해 서버의 기본으로 설치되어 있는 방화벽 및 selinux를 비활성화 하겠습니다.

1-1 방화벽 비활성화
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld


1-2 selinux 비활성화
rpm -q grubby
grubby --update-kernel ALL --args selinux=0
reboot


getenforce




2.tacacs 설치 및 스위치 연동

2-1. 저장소 활성화 및 필요 패키지 설치
dnf install -y epel-release
dnf makecache
dnf --enablerepo=epel,crb \
install -y --setopt=install_weak_deps=False \
tacacs policycoreutils-python-utils


2-2. 설정 디렉터리 및 로그 디렉터리 생성
mkdir -p /etc/tacacs
mkdir -p /var/log/tac_plus
touch /var/log/tac_plus/{acct.log,auth.log,log}
chown root:root /var/log/tac_plus/*
chmod 640 /var/log/tac_plus/*

2-3.설정 파일 작성
vi /etc/tacacs/tac_plus.conf

# 사용 할 key값 설정
key = "MySecretKey123"

# 회계 로그 파일(명령/세션 이력)
accounting file = /var/log/tac_plus/acct.log

# (선택) syslog 시설 지정 — 생략 시 내부 기본 로깅 사용
# logging = local5

user = admin {
  default service = permit # ← 권한(authorization) 기본 허용(필수!)
  login = cleartext "Neteng@123!"
  service = shell { priv-lvl = 15 }
}

:wp 로 저장

tacacs 설정 내용

 

2-4.systemd 유닛 경로 맞추기

ln -s /etc/tacacs/tac_plus.conf /etc/tac_plus.conf

 

2-5.tacacs 데몬 실행

systemctl daemon-reload
systemctl enable --now tac_plus
systemctl status tac_plus --no-pager

tac_plus의 상태 확인


2-6.스위치 설정(C9200L  시스코 스위치에 17.3.5 펌웨어로 진행했습니다.)
conf t
!
aaa new-model
!
tacacs server TAC130
address ipv4 192.168.10.130
key MySecretKey123
!
aaa authentication login DEFAULT group tacacs+ local
aaa authorization exec  DEFAULT group tacacs+ local
aaa accounting commands 15 DEFAULT start-stop group tacacs+
!
line vty 0 15
login authentication DEFAULT

'show tacacs 명령어로 상태 확인

이제 서버에서 등록한 계정으로 스위치를 접속해 봅니다.
login as: admin
Keyboard-interactive authentication prompts from server:
Password:Neteng@123!
End of keyboard-interactive prompts from server

Switch>



지금까지 tacacs 서버 설치 및 스위치 연동까지 진행하였습니다.

 

감사합니다.

댓글