screen-ssh-agent plugin added; to enable the ssh-agent within screen

This commit is contained in:
bart@bambam 2017-08-03 21:30:31 +02:00
parent d848c94804
commit bd4fc28a3a
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# screen-ssh-agent plugin
This plugin enables the `ssh-agent` within a screen session.
To enable it, add `screen-ssh-agent` to your plugins:
```zsh
plugins=(... screen-ssh-agent)
```
## Written by
Bart Dorlandt
[https://github.com/bambam82](https://github.com/bambam82)

View File

@ -0,0 +1,10 @@
if [ $SSH_AUTH_SOCK ]; then
# set up SSH agent socket symlink
export SSH_AUTH_SOCK_LINK="/tmp/ssh-$USER/agent"
if ! [ -r $(readlink -m $SSH_AUTH_SOCK_LINK) ] && [ -r $SSH_AUTH_SOCK ]; then
mkdir -p "$(dirname $SSH_AUTH_SOCK_LINK)" &&
chmod go= "$(dirname $SSH_AUTH_SOCK_LINK)" &&
ln -sfn $SSH_AUTH_SOCK $SSH_AUTH_SOCK_LINK
fi
fi