Created
January 2, 2023 15:01
-
-
Save todashuta/dcc7c1c805e6716b0813813f114445d3 to your computer and use it in GitHub Desktop.
ssh configにtmuxを起動するコマンドも書いてみた
This file contains 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
# $ ssh example-tmux | |
# を実行したときに、 | |
# $ ssh example -t -- tmux -u -2 attach | |
# を実行させる設定の書き方 | |
# | |
# Matchを使うことで名前に-tmuxが付くときだけに有効な設定を書くことができて、 | |
# ユーザー名やポートなどの設定は共通化できる | |
Host example example-tmux | |
HostName example.com | |
User foo | |
Port 10022 | |
#ForwardAgent yes | |
Match originalhost example-tmux | |
RemoteCommand tmux -u -2 attach | |
RequestTTY yes | |
Match all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment