ssh-agent: nuke agent on lock
This commit is contained in:
@@ -29,7 +29,12 @@ Use ./stow.sh --unstow <folder_name> to remove configuration
|
|||||||
- gamemode configuration:
|
- gamemode configuration:
|
||||||
- renice=10
|
- renice=10
|
||||||
- diff for .ohmyzsh via patch files
|
- diff for .ohmyzsh via patch files
|
||||||
|
- ssh-agent:
|
||||||
|
- ohmyzsh patch for agent location
|
||||||
|
- `mv $HOME/.dots/remove-ssh.service ~/.config/systemd/user/remove-ssh.service`
|
||||||
|
- `systemctl --user start remove-ssh`
|
||||||
|
- `systemctl --user enable remove-ssh`
|
||||||
|
|
||||||
## Software
|
## Software
|
||||||
|
|
||||||
### Basics
|
### Basics
|
||||||
|
|||||||
8
remove-ssh.bash
Executable file
8
remove-ssh.bash
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" |
|
||||||
|
while read x; do
|
||||||
|
case "$x" in
|
||||||
|
*"boolean true"*) echo SCREEN_LOCKED; ssh-add -D;;
|
||||||
|
*"boolean false"*) echo SCREEN_UNLOCKED;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
10
remove-ssh.service
Normal file
10
remove-ssh.service
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Remove SSH keys on lock
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Environment=SSH_AUTH_SOCK=/tmp/agent.sock
|
||||||
|
ExecStart=%h/.dots/remove-ssh.bash
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
Reference in New Issue
Block a user