Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I start yubikey-agent as a service on Mac (without brew) #138

Open
etorreborre opened this issue Feb 17, 2023 · 1 comment
Open

Comments

@etorreborre
Copy link

Hi, I installed yubikey-agent via Nix, and more precisely via flox, which means that I am not using Homebrew. The user manual says that I should be able to use launchctl to start yubikey-agent as a service but unfortunately I don't know how to do this.

Is there like a two-liner which can do this or is the setup more involved? Thanks for your guidance.

@artyom
Copy link

artyom commented Apr 19, 2023

Create a $HOME/Library/LaunchAgents/io.filippo.yubikey-agent.plist file with the content similar to this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>io.filippo.yubikey-agent</string>
    <key>Program</key>
    <string>/Users/artyom/go/bin/yubikey-agent</string>
    <key>ProgramArguments</key>
    <array>
		<string>yubikey-agent</string>
		<string>-l</string>
		<string>/tmp/yubikey-agent/yubikey-agent.sock</string>
    </array>
    <key>ProcessType</key>
    <string>Standard</string>
    <key>KeepAlive</key>
    <true/>
	<key>StandardOutPath</key>
	<string>/tmp/yubikey-agent.stdout</string>
	<key>StandardErrorPath</key>
	<string>/tmp/yubikey-agent.stderr</string>
	<key>Sockets</key>
	<dict>
	    <key>Listeners</key>
	    <dict>
		<key>SockPassive</key>
		<false/>
		<key>SockPathName</key>
		<string>/tmp/yubikey-agent/yubikey-agent.sock</string>
	    </dict>
	</dict>
</dict>
</plist>

Tweak it appropriately, at minimum, replace path to yubikey-agent binary (it's /Users/artyom/go/bin/yubikey-agent in that snippet).

Once you have this file in place, start the service by running

launchctl load $HOME/Library/LaunchAgents/io.filippo.yubikey-agent.plist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants