On Mon, 2016-05-23 at 08:23 +0100, Neil Williams wrote: > Ansgar Burchardt wrote: > > Features: > > screen: Can talk to serial console. > > tmux: Does work after switch users (to non-root) > I'm not a tmux user but I'm confused how this is a feature of tmux > and > how that differs from just using sudo / su inside any particular > shell > or inside screen or using support within screen to attach to a > session > detached by another user.
`screen` requires permission to open the client tty, `tmux` doesn't. If you first switch to a different user (`sudo -u user-b -s`) and then try to attach to a screen session, it will fail as user-b doesn't have access to the tty owned by user-a (unless user-b happens to be root). Running `su` inside a screen session is something entirely different. This works with `tmux` as it doesn't have the "server" process opening the "client" tty device; so there are no permission problems. > > I admit I personally prefer tmux as it keeps working after > > switching > > to another user. > I frequently switch users inside screen (and screen maintains that > user as one of the screen windows). screen can also connect to > someone > else's detached screen. From the manpage: > > -r sessionowner/[pid.tty.host] resumes a detached screen > session. No > other options (except com‐ binations with -d/-D) may be specified, > though an optional prefix of [pid.]tty.host may be needed to > distinguish between multiple detached screen sessions. The second > form is used to connect to another user's screen session which runs > in > multiuser mode. This indicates that screen should look for > sessions > in another user's directory. This requires setuid-root. "requires setuid-root" is probably something that should be avoided if possible. Ansgar