-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
_posts/2017-03-07-simple-daemon-for-lock-and-unlock-macos-with-yubikey.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
layout: post | ||
title: Simple Daemon for lock and unlock macOS with Yubikey | ||
tags: [yubikey, mac, osx, macos lock, key, security, daemon] | ||
published: true | ||
--- | ||
|
||
# yubikeylockd | ||
|
||
Simple daemon for locking and unlocking OS X with Yubikey. | ||
|
||
## Install | ||
|
||
Via Homebrew formula: | ||
|
||
{% highlight bash %} | ||
brew install https://raw.githubusercontent.com/shtirlic/yubikeylockd/master/yubikeylockd.rb | ||
{% endhighlight %} | ||
|
||
Manual install: | ||
|
||
{% highlight bash %} | ||
git clone https://github.com/shtirlic/yubikeylockd.git | ||
make clean && make | ||
{% endhighlight %} | ||
|
||
## Additional requirements | ||
* [YubiKey using the native smart card (PIV) mode](https://www.yubico.com/why-yubico/for-businesses/computer-login/mac-os-login/) | ||
* Require password *immediately* after sleep or screen saver begins | ||
![](http://i.imgur.com/URXUukP.png){: height="200px" } | ||
|
||
## How it works | ||
|
||
When you attach Yubikey for the first time launchctl will run yubikeylockd daemon | ||
that will simply monitor the state of the Yubikey USB devices. | ||
Daemon based on the sample provided by Apple for IOKit development. | ||
|
||
It does two things: | ||
* when device is attached it makes activity via | ||
```IOPMAssertionDeclareUserActivity``` call to turn screen on | ||
* after device is detached it uses ```IORequestIdle``` to put display to sleep and (if you configured it) also locks the OS X | ||
|
||
|
||
Links | ||
----- | ||
* [Github yubikeylockd project](https://github.com/shtirlic/yubikeylockd) |