Hi,

I need to run Tor Browser as another user…

So here what I’m doing under, MX Linux ( Debian, SysVinit, xfce)

#as root, in a terminal under xfce

useradd --create-home --system --shell /usr/sbin/nologin TorUser
# btw --system or not ?

tar -xf tor-browser-linux...tar -C /opt --totals
chown -R TorUser:TorUser /opt/tor-browser

runuser -u TorUser -- /opt/tor-browser/start-tor-browser.desktop

return

Launching ‘./Browser/start-tor-browser --detach’…

But nothing happen, and I don’t see any process for TorUser

any ideas ?

Posted on the offical Tor-browser in June, but no reactions so far… :/

  • Gordon_F@lemmy.mlOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 days ago

    I create also a “regular user” TorUser2
    To see if it generate the same problems
    This user have the .Xauthority file.\

    # as root user
    runuser -u TorUser2 -- /opt/tor-browser/start-tor-browser.desktop
    

    return Launching ‘./Browser/start-tor-browser --detach…’
    and ps -u TorUser2 return nothing…


    I’ve tried also

    runuser -l TorUser2 -c '/opt/tor-browser/start-tor-browser.desktop'
    

    /usr/bin/env: ‘./Browser/execdesktop’: No such file or directory

  • mina86@lemmy.wtf
    link
    fedilink
    English
    arrow-up
    4
    ·
    3 days ago

    Capital letters in user names. 🤮

    Debian has torbrowser-launcher you might wanna take a look at that.

    As for the issue, this could be because the user lacks credentials to connect to the display.

    • Korhaka@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      5
      ·
      3 days ago

      Allows multiple easy to remember users. You can have user, User, uSer, USeR, USER, uSER…

  • Elieas@lemmy.ml
    cake
    link
    fedilink
    arrow-up
    2
    ·
    3 days ago

    TorUser doesn’t have access to your current user’s display. You need to first give access using something like xauth or xhost.

      • mina86@lemmy.wtf
        link
        fedilink
        English
        arrow-up
        5
        ·
        3 days ago

        No, do not do that. This gives access to the display to anyone who can connect to it. The proper way is to give the user access to file whose path is in $XAUTHORITY.

        • Gordon_F@lemmy.mlOP
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          2 days ago

          Thank you @[email protected] I’ve look where point the $XAUTHORITY but it point to another user /home/<aUser>/.Xauthority and to give access to the file I have to change also the permission on the parent folders… not to hot to do so…

          I see also the TorUser do not have a file .Xauthority ! I’ve look how generate one for it, but I found no good documentation ! They show how do it once logged with TorUser ! but mine is not meant to be used to login on the system…

          • mina86@lemmy.wtf
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 days ago

            You can just copy the file and set XAUTHORITY as necessary. Just make sure only the desired user can read it.

          • Gordon_F@lemmy.mlOP
            link
            fedilink
            arrow-up
            1
            ·
            2 days ago

            I’ve try one guidance, but it didn’t worked.

            I quit the xfce, login as root, did

            echo $XAUTHORITY
            #returned nothing
            
            XAUTHORITY=/tmp/.Xauthority.tmp
            xauth -f $XAUTHORITY generate :0 . trusted
            

            and after few minute it returned

            xauth: (argv):1 unable to open display :0 😢

            • kumi@feddit.online
              link
              fedilink
              English
              arrow-up
              1
              ·
              edit-2
              2 days ago

              Do you get a different result if you replace that :0 with your actual DISPLAY value?

              Also make sure you run that in a context that does have access to the x server (i guess keep your display manager running as you do this).

              Depending on your setup you should be running such commands as normal user instead of root.

  • mumblerfish@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    3 days ago

    I don’t use .desktop files that much… But I guess xfce is X and not wayland. Check the DISPLAY env var for your user and set the same in your script there or run the binary with that env var.