modify tmux and ssh to recover SSH_AUTH_SOCK after tmux reconnect
This commit is contained in:
7
base/.ssh/rc
Normal file
7
base/.ssh/rc
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Fix SSH auth socket location so agent forwarding works with tmux.
|
||||||
|
if test "$SSH_AUTH_SOCK" ; then
|
||||||
|
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
|
||||||
|
fi
|
||||||
|
|
||||||
@@ -21,3 +21,7 @@ if-shell -b '[ "$(echo "$TMUX_VERSION >= 3.3" | bc)" = 1 ]' {
|
|||||||
set-option -a terminal-features 'xterm-256color:RGB'
|
set-option -a terminal-features 'xterm-256color:RGB'
|
||||||
set-option -sg escape-time 10
|
set-option -sg escape-time 10
|
||||||
set-option -g focus-events on
|
set-option -g focus-events on
|
||||||
|
|
||||||
|
# fix ssh agent when tmux is detached
|
||||||
|
set -g update-environment -r
|
||||||
|
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
|
||||||
|
|||||||
Reference in New Issue
Block a user