Last active
May 5, 2022 18:21
-
-
Save oliora/5e9d2b62e75205773bd70433c4f1e569 to your computer and use it in GitHub Desktop.
tmux and ssh agent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to ~/.bashrc or ~/.zshrc or whatever shell you use | |
if [ -e $HOME/.ssh/ssh_auth_sock ]; then | |
export SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Fix SSH auth socket location so agent forwarding works with tmux | |
if ! [ -e ~/.ssh/ssh_auth_sock ]; then | |
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock | |
fi | |
# Location: | |
# ~/.ssh/rc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setw -g xterm-keys on | |
set -g default-terminal "screen-256color" | |
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
set -g mouse on | |
new-session -n $HOST | |
#set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY" | |
#setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock | |
# Add to ~/.tmux.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment