Created
July 14, 2018 18:35
-
-
Save erdii/a4217a08849f9799ed04b3eee39bdd13 to your computer and use it in GitHub Desktop.
global ssh-agent on ubuntu 16.04 with gnome 3 and systemd
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
# create a user service for our ssh-agent | |
mkdir -p .config/systemd/user/ | |
cat > .config/systemd/user/ssh-agent.service <<EOF | |
[Unit] | |
Description=SSH key agent | |
[Service] | |
Type=simple | |
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket | |
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK | |
[Install] | |
WantedBy=default.target | |
EOF | |
systemctl --user daemon-reload && \ | |
systemctl --user enable ssh-agent && \ | |
systemctl --user start ssh-agent | |
# disable ssh component in gnome-keyring | |
cp /etc/xdg/autostart/gnome-keyring-ssh.desktop . | |
echo "Hidden=true" | tee gnome-keyring-ssh.desktop | |
# relogin and enjoy! | |
# PS: my .zshrc contains this line | |
eval `keychain --eval --agents ssh` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From https://wiki.archlinux.org/index.php/GNOME/Keyring#Disable_keyring_daemon_components