-
-
Save jimblue/202d9434bc0bc55d34da626ba674452e to your computer and use it in GitHub Desktop.
Summary of my remote tmux and ssh configuration to benefit from the iterm2-tmux integration, with ssh authentication socket refreshing
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
| # This is a fragment of ~/.ssh/config (local) | |
| Host tmux | |
| HostName remote.host.some.where | |
| ForwardAgent yes | |
| RemoteCommand tmux -CC new -A -s tmux-main | |
| RequestTTY yes |
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 | |
| # This is ~/.ssh/rc (remote) | |
| if [ ! -S $HOME/.ssh/ssh_auth_sock -a -S "$SSH_AUTH_SOCK" ]; then | |
| ln -sf $SSH_AUTH_SOCK ~/.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
| # This is ~/.tmux.conf (remote) | |
| set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY" | |
| set-environment -g 'SSH_AUTH_SOCK' $HOME/.ssh/ssh_auth_sock | |
| set -g set-titles on | |
| # not all distros have a tmux terminal type | |
| #set -g default-terminal tmux | |
| set -g default-terminal xterm-color |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment