Skip to content

Instantly share code, notes, and snippets.

@sheerlox
Last active March 3, 2019 11:01
Show Gist options
  • Save sheerlox/33ce089325f9e4a1633f71e00e90cf6a to your computer and use it in GitHub Desktop.
Save sheerlox/33ce089325f9e4a1633f71e00e90cf6a to your computer and use it in GitHub Desktop.
Fix for ssh-agent failing after disabling gnome-keyring in Ubuntu, execute after startup.
#!/bin/bash
SSH=$(ssh-agent -s)
SSH_AUTH_SOCK=$(echo "$SSH" | sed '2d' | sed '2d' | cut -d'=' -f2 | cut -d';' -f1)
SSH_AGENT_PID=$(echo "$SSH" | sed '1d' | sed '2d' | cut -d'=' -f2 | cut -d';' -f1)
export SSH_AUTH_SOCK;
export SSH_AGENT_PID;
ssh-add /home/sherlock/.ssh/github_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment