Last active
March 23, 2023 23:03
-
-
Save cyberdelia/91f7ec06a745310cec0615820ead8652 to your computer and use it in GitHub Desktop.
Secure Agent — Authentication agent using the Secure Enclave
This file contains hidden or 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
| function start_ssh_agent() { | |
| secure-agent daemon | sed 's/^echo/#echo/' >! $ssh_environment | |
| chmod 600 $ssh_environment | |
| source $ssh_environment > /dev/null | |
| } | |
| ssh_environment="$HOME/.ssh/environment" | |
| if [[ -f "$ssh_environment" ]]; then | |
| source $ssh_environment > /dev/null | |
| ps x | grep secure-agent | grep -q $SSH_AGENT_PID || { | |
| start_ssh_agent | |
| } | |
| else | |
| start_ssh_agent | |
| fi | |
| unset ssh_environment | |
| unfunction start_ssh_agent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment