6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ssh先のtmuxでssh-agentの接続が切れてしまう問題の回避策

Posted at

workaround

tmuxを起動するhomeディレクトリの .bashrc に以下の設定を追加する

~/.bashrc
[[ $SSH_AUTH_SOCK != $HOME/.ssh/sock && -S $SSH_AUTH_SOCK ]] \
    && ln -snf "$SSH_AUTH_SOCK" "$HOME/.ssh/sock" \
    && export SSH_AUTH_SOCK="$HOME/.ssh/sock"

参考:

https://werat.github.io/2017/02/04/tmux-ssh-agent-forwarding.html
https://serverok.in/ssh-agent-forwarding-with-tmux
https://gist.github.com/martijnvermaat/8070533
https://qiita.com/sonots/items/2d7950a68da0a02ba7e4

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?