0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

tmux でセッション共有しようとすると "tmux not allowed" と出る

Posted at

概要

tmux でセッション共有しようとすると tmux not allowed と表示され共有できない場合があります。
最近の tmux でセッションを共有するユーザをチェックする機能が追加されたことが原因のようです。

共有する側

ソケットファイル /tmp/tmux.sock を作成して tmux を起動します。

tmux -S /tmp/tmux.sock

ソケットファイルのパーミッションを
共有する相手が読み書きできるよう変更します。

chmod -c 777 /tmp/tmux.sock

共有してもらう側

ソケットファイルを指定して tmux にアタッチしようとすると…

tmux -S /tmux/tmux.sock attach

以下のように表示されセッション共有ができません。

access not allowed

対策

Stack Overflow にこの挙動に関する質問が投稿されていました。
tmux shared socket throws "access not allowed" error - Stack Overflow

共有する側

tmux セッション内で以下のコマンドを実行することで
セッションを共有するユーザの許可を追加します。

tmux server-access -a 許可するユーザ名

現在セッション共有を許可されているユーザは
以下のコマンドで確認できます。

tmux server-access -l

共有してもらう側

セッション共有を許可してもらってからアタッチします。

tmux -S /tmux/tmux.sock attach
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?