Connect Yubikey  ,then initialize YubiKey slot 2:

ykpersonalize -2 -ochal-resp -ochal-hmac -ohmac-lt64 -oserial-api-visible
...
Commit? (y/n) [n]: y

Create /var/yubico directory for challenge file.

sudo mkdir /var/yubico

sudo chown root.root /var/yubico
sudo chmod 700 /var/yubico
ykpamcfg -2 -v
...
Stored initial challenge and expected response in '$HOME/.yubico/challenge-123456'.
sudo mv ~/.yubico/challenge-123456 /var/yubico/xiaoxiaoleo-123456
sudo chown root.root /var/yubico/xiaoxiaoleo-123456
sudo chmod 600 /var/yubico/xiaoxiaoleo-123456

TIPs: xiaoxiaoleo is the login user name.

add pam config before the first line /etc/pam.d/login:

auth   required        pam_yubico.so mode=challenge-response chalresp_path=/var/yubico

Add debug arg for debug infomation:

auth   required        pam_yubico.so mode=challenge-response debug chalresp_path=/var/yubico

Create yubico pam debug log file:

touch /var/run/pam-debug.log
chmod go+w /var/run/pam-debug.log

SELinux ERROR:

[pam_yubico.c:do_challenge_response(614)] Cannot open file: /var/yubico/test-5212345(No such file or   directory )

Error communicating with Yubikey,please check syslog or contact your system administrator

[pam_yubikco.c:display_error(425)] conv returned:'(null)'

[pam_yubico.c:do_challenge_response(673)] Challenge Response failed: No such file or directory

Create SELinux policy :

grep avc /var/log/audit/audit.log | audit2allow -M yubikey
module yubikey 1.0;

define(`r_file_perms', `{ getattr open read ioctl lock }')

require {

    type var_t;

    type local_login_t;

}

allow local_login_t var_t:file r_file_perms

Compile and install SELinux policy:

 checkmodule -M -m -o yubikey.mod yubikey.te
semodule_package -o yubikey.pp -m yubikey.mod
semodule -i yubikey.pp

Local Authentication Using Challenge Response with Yubikey for CentOS 7的更多相关文章

  1. Challenge–response authentication 挑战(询问)应答机制

    In computer security, challenge–response authentication is a family of protocols in which one party ...

  2. HMAC在“挑战/响应”(Challenge/Response)身份认证的应用

    HMAC的一个典型应用是用在"挑战/响应"(Challenge/Response)身份认证中. 认证流程 (1) 先由客户端向服务器发出一个验证请求. (2) 服务器接到此请求后生 ...

  3. samba常用命令

    1.# smbstatusSamba version 3.6.23PID Username Group Machine ---------------------------------------- ...

  4. [转]The NTLM Authentication Protocol and Security Support Provider

    本文转自:http://davenport.sourceforge.net/ntlm.html#ntlmHttpAuthentication The NTLM Authentication Proto ...

  5. sip user Authentication and 401

    https://www.vocal.com/sip-2/sip-user-authentication/ https://tools.ietf.org/html/rfc3261 SIP User Au ...

  6. Samba set of user authentication and file access rights

    This series is compatible with Linux certification exam LPIC. A typical Linux user-level topics omit ...

  7. Central Authentication Service

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...

  8. 爬虫框架Scrapy之Request/Response

    Request yield scrapy.Request(url, self.parse) Request 源码: # 部分代码 class Request(object_ref): def __in ...

  9. Scrapy爬虫入门Request和Response(请求和响应)

    开发环境:Python 3.6.0 版本 (当前最新)Scrapy 1.3.2 版本 (当前最新) 请求和响应 Scrapy的Request和Response对象用于爬网网站. 通常,Request对 ...

随机推荐

  1. Python初步

    准备在工作之余看看Python的东西 收录一些资料 Python初学者(零基础学习Python.Python入门)常见问题:书籍推荐.资料.社区 http://blog.csdn.net/xiaowa ...

  2. ionic 入口禁止加载其他页面

    .state('memberOrders', { prefetchTemplate: false, url: '/memberOrders', templateUrl: '/MemberOrders' ...

  3. Python 3 学习笔记之——错误和异常

    1. 语法错误 Python 的语法错误被称为解析错,语法分析器会指出出错的代码行,并且在最先找到的错误的位置标记一个小小的箭头. >>> while True File " ...

  4. BZOJ 3998 TJOI2015 弦论 后缀自动机+DAG上的dp

    题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=3998 题意概述:对于一个给定长度为N的字符串,求它的第K小子串是什么,T为0则表示不同位置 ...

  5. angular强制刷新

    有时候请求完毕,某些变量重新赋值后不会体现在页面上,此时需要强制刷新 $scope.$apply(function () { $scope.message ="Timeout called! ...

  6. dechex()

    dechex() 函数把十进制转换为十六进制生成验证码的时候用到了

  7. PHP变量类型转换

    PHP数据类型转换 PHP的数据类型转换属于强制转换,允许转换的PHP数据类型有: •(int).(integer):转换成整形 •(float).(double).(real):转换成浮点型 •(s ...

  8. 算法(13)Contiguous Array

    题目:找出数组的一个子数组,要求这个子数组中0和1的数量相等,找出最大长度的这样的数组! 思路:也是受网上算法的启发吧,用一个 语言:如何初始化一个unordered_map<int,int&g ...

  9. 用WebService实现两个整数运算

    最近,项目开发中需要用到Web Service.自己在网上搜集资料.自己做了一个小例子,用来加深自己对Web Service理解. 概念:Web Service主要是为了使原来各孤立的站点之间的信息能 ...

  10. LeetCode -- Tiangle

    Question: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to ...