Skip to content

Comment on Tmux, for fun and profitparent

Comments

  > Both pairs get access to whatever user starts tmux
IIRC, if you 'host' a (gnu) screen session, then your pair will create new shells as your user. This is not a tmux-only issue.
  > What we came up with is creating a new
  > "pair user" and running tmux within that.
That's an idea that I had, but hadn't attempted to look into yet. This also gets around the screen suid root issue (though not necessarily the config issue), if you're both logged in as the same user. How has this been working, any caveats?
  > The configuration wasn't a problem for us
  > since one of us hadn't ever used tmux and
  > had therefore had no opinion.
I use ` instead of C-a/C-b in both screen and tmux, so it could be a bit jarring to others.

> That's an idea that I had, but hadn't attempted to look into yet. This also gets around the screen suid root issue (though not necessarily the config issue), if you're both logged in as the same user. How has this been working, any caveats?

I'm not sure why you need to set suid on tmux. Before we created the pair user I just used the -S option to specify a socket path and then chmoded the created socket so my pair could access it.

So far so good with the new pair user. The only thing that's different is that to push our changes up to the main repo we need ssh keys and we haven't gone through the trouble of creating a new ssh key for the pair user and adding it to our teams github repo, so we have to git push and pull from a non-pair login. That can be fixed when it gets annoying but so far I'm always logged in to that machine as myself as well as the pair user so I can just switch tabs and git push/pull when needed.

> I use ` instead of C-a/C-b in both screen and tmux, so it could be a bit jarring to others.

I use C-\ myself since C-a and C-b are both prominent Emacs keys.

  > I'm not sure why you need to set suid on tmux
I guess I should have been clearer:
  > This also gets around the "GNU screen" suid root issue
You can easily fix this. You can:

1) Use a combination of ssh-agent fowarding and manually exporting the $SSH_AUTH_SOCK variable to switch between two users' ssh-agent sockets.

2) Each user commits from a separate window/shell. Each window/shell has a separate ssh-agent running in it, with that user's ssh key ssh-add'd to it.

Though, options 2 is less secure.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.