5

How to attach to a session created on a remote server with my local tmux client ?

I known I can install tmux on the remote machine and do something like ssh -t ... tmux attach. But I want my local configuration, clipboard, etc...

There is a lot of questions about this but the answer is always about nesting tmux instances. I don't want to do this.

Is it possible ? If yes, is it possible to leave detached session on the remote (with tmux installed on the remote machine) ? If no, is there alternatives to tmux that can do that?

1
  • No comment, no asnwer. Is there anything that can be said about this?
    – KcFnMi
    Aug 4, 2018 at 3:30

1 Answer 1

1

No, this is not possible to do as you wanted. Tmux requires nested sessions for connecting to a remote session.

You indeed need to do SSH connection and then attach the session. This way tmux uses configuration of the remote server. Again, as you didn't want.

Maybe in the future this feature will be added to tmux. Sorry.

I don't know if screen supports this kind of feature. That might be an alternative, if it does.

3
  • 1
    I ended up either copy the local config on the remote machine (tmux -f) and lose the clipboard or run tmux locally and spawn an ssh connection for every tab/pane.
    – juloo65
    Nov 5, 2018 at 10:37
  • Great! That is exactly how one would do this, without the feature. I tried to search if screen has this feature, but I couldn't anything (it probably doesn't have it). Nov 5, 2018 at 10:43
  • @juloo65 "run tmux locally and spawn an ssh connection" unfortunately this is not a solution. At least not utilizing one of the crucial remote tmux benefits which is a server-persistent session protecting from spurious SSH disconnections, local machine shutdowns and all that. Btw. do you guys know whether situation with this hypothetical tmux feature has changed since?
    – bloody
    Apr 7, 2023 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .