Local Authentication Using Challenge Response with Yubikey for CentOS 7

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
时间: 2024-10-13 23:42:28

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

Challenge–response authentication

In computer security, challenge–response authentication is a family of protocols in which one party presents a question ("challenge") and another party must provide a valid answer ("response") to be authenticated. The simplest example

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

HMAC的一个典型应用是用在“挑战/响应”(Challenge/Response)身份认证中. 认证流程 (1) 先由客户端向服务器发出一个验证请求. (2) 服务器接到此请求后生成一个随机数并通过网络传输给客户端(此为挑战). (3) 客户端将收到的随机数提供给ePass,由ePass使用该随机数与存储在ePass中的密钥进行HMAC-MD5运算并得到一个结果作为认证证据传给服务器(此为响应). (4) 与此同时,服务器也使用该随机数与存储在服务器数据库中的该客户密钥进行HMAC-MD5运算,

Samba set of user authentication and file access rights

This series is compatible with Linux certification exam LPIC. A typical Linux user-level topics omitted, I am picked up the contents of the system management and server management. In addition, not only LPIC measures, we have questions problem asking

Scrapy框架----- Request/Response

Request Request 部分源码: # 部分代码 class Request(object_ref): def __init__(self, url, callback=None, method='GET', headers=None, body=None, cookies=None, meta=None, encoding='utf-8', priority=0, dont_filter=False, errback=None): self._encoding = encoding #

Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/vm10-0-0-19

输入:service mysqld start 报错: Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/vm10-0-0-19.ksc.com.pid). 解决: ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ 参考

OPENVPN搭建与配置

Content-type: text/html; charset=UTF-8 openvpn Section: Maintenance Commands (8)Updated: 17 November 2008Index Return to Main Contents NAME openvpn - secure IP tunnel daemon. SYNOPSIS openvpn [ options ... ] INTRODUCTION OpenVPN is an open source VPN

利用SMTP发送Mail详解

利用SMTP发送Mail详解 分类: VC++程式开发 技术杂谈 2010-01-09 11:02 4135人阅读 评论(0) 收藏 举报 服务器headerdatesocket网络2010 在以前接触的项目中,一直都是在做网站时用到了发送mail 的功能,在asp 和.net 中都有相关的发送mail 的类, 实现起来非常简单.最近这段时间因工作需要在C++ 中使用发送mail 的功能,上网搜了一大堆资料,终于得以实现,总结自己开发过程中碰到的一些问题,希望对需的人有所帮助, 由于能力有限,

RFID 克隆/仿真/模拟/监控/拦截/检测/嗅探器

Demo: Cloning a Verichip Yourself Download I have: schematics as PDF BOM, with Digikey part numbers board artwork (Gerbers and drill file) PIC source code (assembly for MPASM / IHEX binary) Theory of Operation Please refer to the schematic. It's impo

[转]关于NTLM认证的.NET,php,python登录

本文转自:http://www.cnblogs.com/myx/archive/2013/03/25/php-ntlm-python-net.html 早期SMB协议在网络上传输明文口令.后来出现 LAN Manager Challenge/Response 验证机制,简称LM,它是如此简单以至很容易就被破解.微软提出了WindowsNT挑战/响应验证机制,称之为NTLM.现在已经有了更新的NTLMv2以及Kerberos验证体系.NTLM是windows早期安全协议,因向后兼容性而保留下来.N