Skip to content

Instantly share code, notes, and snippets.

@todashuta
Created January 2, 2023 15:01
Show Gist options
  • Save todashuta/dcc7c1c805e6716b0813813f114445d3 to your computer and use it in GitHub Desktop.
Save todashuta/dcc7c1c805e6716b0813813f114445d3 to your computer and use it in GitHub Desktop.
ssh configにtmuxを起動するコマンドも書いてみた
# $ 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