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

  要想在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无疑被更多的应用于企业所用的服务器当中。而且还能支持多协议,所以,这一块的内容可是不得不学的哦、

西部数码(west.cn)是经工信部审批,持有ISP、云牌照、IDC、CDN全业务资质的正规老牌云服务商,自成立至今20余年专注于域名注册虚拟主机云服务器企业邮箱、企业建站等互联网基础服务!
公司自研的云计算平台,以便捷高效、超高性价比、超预期售后等优势占领市场,稳居中国接入服务商排名前三,为中国超过50万网站提供了高速、稳定的托管服务!先后获评中国高新技术企业、中国优秀云计算服务商、全国十佳IDC企业、中国最受欢迎的云服务商等称号!
目前,西部数码高性能云服务器正在进行特价促销,最低仅需48元!
https://www.west.cn/cloudhost/

赞(0)
声明:本网站发布的内容(图片、视频和文字)以原创、转载和分享网络内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-62778877-8306;邮箱:fanjiao@west.cn。本站原创内容未经允许不得转载,或转载时需注明出处:西部数码知识库 » 如何在linux服务器上实现tacacs认证

登录

找回密码

注册