Skip to content

Instantly share code, notes, and snippets.

@rodrigogs
Created September 17, 2019 19:55
Show Gist options
  • Save rodrigogs/769292fd199fdc7a3d009c2c4afbf253 to your computer and use it in GitHub Desktop.
Save rodrigogs/769292fd199fdc7a3d009c2c4afbf253 to your computer and use it in GitHub Desktop.
Setup the KDE environment to automatically initialize the ssh agent and load the keys from .ssh.
#!/bin/bash
sudo apt install ksshaskpass -y
ssh_keys=$(find "${HOME}/.ssh" -type f ! -name "*.*" | tr '\n' ' ')
ssh_unlock_script_path="${HOME}/.config/autostart-scripts/ssh-unlock.sh"
rm -rf "${ssh_unlock_script_path}"
echo "#!/bin/bash
SSH_ASKPASS=/usr/bin/ksshaskpass ssh-add ${ssh_keys} </dev/null
" >> "${ssh_unlock_script_path}"
chmod +x "${ssh_unlock_script_path}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment