screen-ssh-agent plugin added; to enable the ssh-agent within screen
This commit is contained in:
parent
d848c94804
commit
bd4fc28a3a
13
plugins/screen-ssh-agent/README.md
Normal file
13
plugins/screen-ssh-agent/README.md
Normal 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)
|
10
plugins/screen-ssh-agent/screen-ssh-agent.zsh
Normal file
10
plugins/screen-ssh-agent/screen-ssh-agent.zsh
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user