如何在linux服务器上实现tacacs认证

发布时间:2022-07-28 11:26 来源:聚名网 阅读:179 作者:聚名网 栏目: 服务器 欢迎投稿:712375056

  要想在Linux实现终端访问,你绕不开的是tacacs和radius认证,如何实现tacacs认证呢?其实并不难,今天小编就给大家带来教程。
  Linux服务器实现tacacs认证,通过PAM(可插拔的认证模块)实现。PAM的接口文件位于/etc/pam.d文件夹下,模块位于/lib/security文件夹中(有些服务器位于lib64/security/)。


  默认PAM安装包中不包括tacacs认证模块,需要下载源代码进行编译,具体步骤如下(已Centos为例):
  1、确认linux服务器中gcc(c编译器)、autoreconf(shell脚本工具)、yum(安装程序工具)是否安装。
  例:rpm -qa |grep yum查看yum是否安装,/etc/yum.repos.d/CentOS-Base.repo中有yum默认程序源配置,一般都是http://mirrors.163.com/centos/6/os/$basearch/。
  autoreconf需要安装automake和libtool,autoreconf、libtool在163镜像中没有,rpm文件见附件。安装命令为:rpm -Uvh 程序名
  2、将pam_tacplus-1.3.9.tar.gz拷贝到服务器中,位置自选。tar zxvf pam_tacplus-1.3.9.tar.gz解压文件。
  3、编译安装pam tacacs模块。
  $ autoreconf -i
  $ ./configure && make && sudo make install
  4、模块默认安装在/usr/local/lib/security,若要修改位置需要再研究。将生成的pam_tacplus.so拷贝到/lib64/security下的
  Libraries have been installed in:
  /usr/local/lib/security
  If you ever happen to want to link against installed librariesin a given directory, LIBDIR, you must either use libtool, and
  specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:
  - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
  during execution
  - add LIBDIR to the `LD_RUN_PATH' environment variable
  during linking
  - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
  - have your system administrator add LIBDIR to `/etc/ld.so.conf'
  5、修改/etc/pam.d/sshd文件,在auth类型中增加以下内容
  tacacs down local配置
  auth       [success=done new_authtok_reqd=done ignore=ignore default=die]   pam_tacplus.so debug server=**.**.**0.199 secret=194.120/32
  tacacslocal配置
  auth       sufficient   pam_tacplus.so debug server=*.*.*.* secret=*****
  注:tacacs认证也需在本地创建帐户,可不设密码。
  相较于保密性相对较差的radius,tacacs无疑被更多的应用于企业所用的服务器当中。而且还能支持多协议,所以,这一块的内容可是不得不学的哦、

来源链接:https://www.juming.com/zx/656.html

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

免责声明:本站发布的内容(图片、视频和文字)以原创、来自本网站内容采集于网络互联网转载等其它媒体和分享为主,内容观点不代表本网站立场,如侵犯了原作者的版权,请告知一经查实,将立刻删除涉嫌侵权内容,联系我们QQ:712375056,同时欢迎投稿传递力量。