Most active commenters

    ←back to thread

    414 points st_goliath | 15 comments | | HN request time: 1.041s | source | bottom
    Show context
    RMPR ◴[] No.43971862[source]
    Nice write-up.

    > Screen offers a multi-user mode which allows to attach to Screen sessions owned by other users in the system (given the proper credentials). These multi-user features are only available when Screen is installed with the setuid-root bit set. This configuration of Screen results in highly increased attack surface, because of the complex Screen code that runs with root privileges in this case

    I wasn't aware of such a feature but I guess it's what makes stuff like tmate possible. Speaking of which, I wonder if tmux is affected by the same kind of vulnerability.

    replies(4): >>43971918 #>>43971987 #>>43973735 #>>43977030 #
    dooglius ◴[] No.43971987[source]
    No, tmux uses unix domain sockets. I have no idea why screen chose to take the setuid approach instead here; it seems totally unnecessary to have root privileges.

    EDIT: Further down, TFA gives a plausible explanation: the current screen devs are not fully familiar with the code base. If so, the setuid-root approach was probably the easiest way to make the feature work in lieu of such familiarity.

    replies(5): >>43972036 #>>43972445 #>>43972504 #>>43973108 #>>43975717 #
    JdeBP ◴[] No.43972036[source]
    screen has a lot of architectural baggage that can be traced back to its initial 1987 comp.sources.unix/mod.sources versions in some cases. Being set-UID to the superuser is one of them. See the doco for screen as it was posted in volume 10:

    https://sources.vsta.org/comp.sources.unix/volume10/screen/

    replies(2): >>43972131 #>>43979137 #
    ngangaga[dead post] ◴[] No.43972131[source]
    [flagged]
    entropie ◴[] No.43972586[source]
    For me it felt (!) like screen is pretty much obsolute since 10+ years. When tmux came I switched and never looked back and I know a few that handled it the same.
    replies(4): >>43972845 #>>43973094 #>>43973786 #>>43979384 #
    1. noosphr ◴[] No.43972845[source]
    Screens main use case is to open an emacs session remotely.

    Tmux's main use case is to be glue for a unix IDE.

    The two use cases are rather different and the tools are very specialized for them.

    replies(5): >>43972976 #>>43973052 #>>43973268 #>>43973704 #>>43973888 #
    2. skydhash ◴[] No.43972976[source]
    I switched to dtach for the first case.
    replies(1): >>43973266 #
    3. anthk ◴[] No.43973052[source]
    Emacs can work as a daemon.
    replies(1): >>43973119 #
    4. noosphr ◴[] No.43973119[source]
    It also has tramp mode which means you can use all your local packages remotely.
    replies(1): >>43973771 #
    5. kps ◴[] No.43973266[source]
    dtach for session persistence. “Do one thing well.”
    6. penguin_booze ◴[] No.43973268[source]
    > Screens main use case is to open an emacs session remotely.

    Not an emacs user, but for this, what does screen do that tmux can't?

    replies(2): >>43973891 #>>43976520 #
    7. johnmaguire ◴[] No.43973704[source]
    I'm confused by this statement. Are you claiming this is the projects' stated goal? Their primary use in the wild?
    8. taeric ◴[] No.43973771{3}[source]
    When I realized how powerful TRAMP was, I don't think I ever used screen/tmux again. I'm sure there are uses, mind. Just TRAMP fully hit all of my needs.
    replies(1): >>43973913 #
    9. jstanley ◴[] No.43973888[source]
    Nah, screen's main use case is as an ad-hoc method to daemonise random scripts.
    replies(2): >>43974505 #>>43978168 #
    10. kstrauser ◴[] No.43973891[source]
    Nothing at all. I’ve used emacs over tmux (and now zellij) for many years. Emacsserver can replace both of them, but that’s a different story.
    11. kstrauser ◴[] No.43973913{4}[source]
    It really is magical, isn’t it? And although I rarely need to use it, I love the multihop setups where you can ssh to this system, then ssh again to this other, then mount an SMB filesystem using these credentials, and start editing.
    12. fnordpiglet ◴[] No.43974505[source]
    Yeah this is 100% of when I reach for screen. “I’m not willing/ready to make this a service, screen detach here I come”
    13. wkat4242 ◴[] No.43976520[source]
    Nothing but replacing it with something newer invalidates decades of muscle memory.

    I switched to tmux eventually though.

    14. senderista ◴[] No.43978168[source]
    Let's see, we have at least daemonize[0], nohup[1], and disown[2] for that. Some discussion of the differences: https://unix.stackexchange.com/questions/3886/difference-bet...

    [0] https://github.com/bmc/daemonize

    [1] https://linux.die.net/man/1/nohup

    [2] https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash....

    replies(1): >>43984769 #
    15. teddyh ◴[] No.43984769{3}[source]
    A more modern alternative is systemd-run: <https://www.freedesktop.org/software/systemd/man/latest/syst...>