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

Installation instructions for macOS with Apple Silicon without using homebrew #154

Open
andrsd opened this issue Sep 10, 2024 · 0 comments

Comments

@andrsd
Copy link

andrsd commented Sep 10, 2024

These are my notes to help users to setup yubikey-agent on macOS with Apple Silicon without homebrew:

I am skipping the obtain the source code, unpack steps. Also, no instructions provided on how to obtain go.

To build the package, use

CGO_ENABLED="1" GOOS=darwin GOARCH=arm64 go build

Copy the binary in place. I picked /usr/local/bin and this will be used in below (this can be changed)

sudo cp yubikey-agent /usr/local/bin

Install for a user:

mkdir -p ~/Library/LaunchAgents
touch ~/Library/LaunchAgents/launched.yubikey-agent.plist

Copy this into the file launched.yubikey-agent.plist:

<?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>launched.yubikey-agent</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/bin/yubikey-agent</string>
		<string>-l</string>
		<string>/private/tmp/yubikey-agent.sock</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>KeepAlive</key>
	<true/>
</dict>
</plist>

Enable the service:

cd ~/Library/LaunchAgents
launchctl bootstrap gui/$UID launched.yubikey-agent.plist
launchctl enable gui/$UID/launched.yubikey-agent.plist

Then, in ~/.ssh/config, use:

Host *
    IdentityAgent /private/tmp/yubikey-agent.sock

Note: the Apple silicon specific step is the build step. I don't have an Intel-based Mac, so IDK what the step should be. My guess is that the GOARCH value would be different.

The rest should work on all recent macOS machines, though.

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

1 participant