7.3. 使用 TACACS 进行互联网用户身份验证

在我的工作场所,对于拨号上网用户的 TACACS 身份验证(这些用户连接到我们的调制解调器池,调制解调器池又连接到几台 Cisco 250x 访问服务器),我们正在使用 Vikas 版本的 “xtacacsd”

在编译和安装 Vikas 软件包(最新版本可从 ftp://ftp.navya.com/pub/vikas 获取;我不认为该软件包有 RPM 格式)后,您应该将以下条目添加到 ``/etc/inetd.conf'' 文件中,以便在收到 TACACS 请求时,inetd 守护程序将加载该守护程序。

# TACACS is a user authentication protocol used for Cisco Router products.
tacacs dgram udp wait root /etc/xtacacsd xtacacsd -c /etc/xtacacsd-conf

接下来,您应该编辑 ``/etc/xtacacsd-conf'' 文件并根据您的系统进行自定义(但是您可能可以使用默认设置)。

注意:注意:如果您正在使用 shadow 密码(详情请参阅第 6.6 节),您将在此软件包中遇到一些问题。不幸的是,Red Hat 用于用户身份验证的 PAM(可插拔身份验证模块)不受此软件包的支持。我使用的一个解决方法是在 ``passwd'' 文件中,位于 ``/usr/local/xtacacs/etc/'',该文件与 /etc/ 中的文件匹配,但不是 shadow 密码文件。这有点麻烦,如果您选择这样做,请确保设置另一个密码文件的权限,以确保只有 root 用户可读

chmod a-wr,u+r /usr/local/xtacacs/etc/passwd

如果您确实使用 shadow 密码,您肯定需要编辑 ``/etc/xtacacsd-conf'' 文件和非 shadow 密码文件的位置(假设您正在使用我上面建议的解决方法)。

下一步是配置您的访问服务器,以使用 TACACS 对所需设备(例如拨号调制解调器)的登录进行身份验证。以下是如何执行此操作的示例会话

mail:/tftpboot# telnet xyzrouter

Escape character is '^]'.
User Access Verification
Password: ****
xyzrouter> enable
Password: ****
xyzrouter# config terminal
Enter configuration commands, one per line.  End with CNTL/Z.
xyzrouter(config)# tacacs-server attempts 3
xyzrouter(config)# tacacs-server authenticate connections
xyzrouter(config)# tacacs-server extended
xyzrouter(config)# tacacs-server host 123.12.41.41
xyzrouter(config)# tacacs-server notify connections
xyzrouter(config)# tacacs-server notify enable
xyzrouter(config)# tacacs-server notify logouts
xyzrouter(config)# tacacs-server notify slip
xyzrouter(config)# line 2 10
xyzrouter(config-line)# login tacacs
xyzrouter(config-line)# exit
xyzrouter(config)# exit
xyzrouter# write
Building configuration...
[OK]  
xyzrouter# exit

Connection closed by foreign host.

所有 TACACS 活动日志消息都将记录在 ``/var/log/messages'' 中,供您查阅。