Running Firefox as root in a regular user's session is not supported. ($XAUTHORITY is /run/user/1000/gdm/Xauthority which is owned by radix.)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












How can I resolve this error?



When I change owner and group of Xauthority file to root, Firefox runs, but it does not work. When I reboot the system, Xauthority automatically changes to its original owner and group name.



P.S.: I'm using Ubuntu 18.04.







share|improve this question






















  • Try to copy the xauthority file to /home/root directory.
    – kukulo
    May 16 at 16:47










  • @kukulo its not working.
    – Harrish Kumar
    May 16 at 17:03






  • 4




    You shouldn't be running things as root. You've probably heard that before, but you really shouldn't be running a browser as root. Have you tried with any other users? What problem are you trying to solve by running as root to begin with?
    – earthmeLon
    May 16 at 18:50











  • @earthmeLon I know I know, but sometimes there are legit resons for that, in my case because I run debian 8 at my workplace and I want to have the latest firefox version, I downloaded firefox from the website and installed in /opt/firefox. As a user I am not able to do updated (because users are not allowed to write on /opt) and the only option to do an update for me is sudo /opt/firefox/firefox -> Help -> About Firefox and wait for the update to be downloaded and applied, then I close firefox. With this new feature has made my updates more difficult.
    – Pablo
    May 23 at 16:51










  • @earthmeLon In my case I could/should have installed firefox on my $HOME and I wouldn't need to run firefox as root for the updates. I only run FF as root like I said not for browsing but for letting FF do an auto-update.
    – Pablo
    May 23 at 16:52














up vote
1
down vote

favorite












How can I resolve this error?



When I change owner and group of Xauthority file to root, Firefox runs, but it does not work. When I reboot the system, Xauthority automatically changes to its original owner and group name.



P.S.: I'm using Ubuntu 18.04.







share|improve this question






















  • Try to copy the xauthority file to /home/root directory.
    – kukulo
    May 16 at 16:47










  • @kukulo its not working.
    – Harrish Kumar
    May 16 at 17:03






  • 4




    You shouldn't be running things as root. You've probably heard that before, but you really shouldn't be running a browser as root. Have you tried with any other users? What problem are you trying to solve by running as root to begin with?
    – earthmeLon
    May 16 at 18:50











  • @earthmeLon I know I know, but sometimes there are legit resons for that, in my case because I run debian 8 at my workplace and I want to have the latest firefox version, I downloaded firefox from the website and installed in /opt/firefox. As a user I am not able to do updated (because users are not allowed to write on /opt) and the only option to do an update for me is sudo /opt/firefox/firefox -> Help -> About Firefox and wait for the update to be downloaded and applied, then I close firefox. With this new feature has made my updates more difficult.
    – Pablo
    May 23 at 16:51










  • @earthmeLon In my case I could/should have installed firefox on my $HOME and I wouldn't need to run firefox as root for the updates. I only run FF as root like I said not for browsing but for letting FF do an auto-update.
    – Pablo
    May 23 at 16:52












up vote
1
down vote

favorite









up vote
1
down vote

favorite











How can I resolve this error?



When I change owner and group of Xauthority file to root, Firefox runs, but it does not work. When I reboot the system, Xauthority automatically changes to its original owner and group name.



P.S.: I'm using Ubuntu 18.04.







share|improve this question














How can I resolve this error?



When I change owner and group of Xauthority file to root, Firefox runs, but it does not work. When I reboot the system, Xauthority automatically changes to its original owner and group name.



P.S.: I'm using Ubuntu 18.04.









share|improve this question













share|improve this question




share|improve this question








edited Jul 24 at 22:56









wjandrea

7,10742054




7,10742054










asked May 16 at 16:43









Harrish Kumar

2415




2415











  • Try to copy the xauthority file to /home/root directory.
    – kukulo
    May 16 at 16:47










  • @kukulo its not working.
    – Harrish Kumar
    May 16 at 17:03






  • 4




    You shouldn't be running things as root. You've probably heard that before, but you really shouldn't be running a browser as root. Have you tried with any other users? What problem are you trying to solve by running as root to begin with?
    – earthmeLon
    May 16 at 18:50











  • @earthmeLon I know I know, but sometimes there are legit resons for that, in my case because I run debian 8 at my workplace and I want to have the latest firefox version, I downloaded firefox from the website and installed in /opt/firefox. As a user I am not able to do updated (because users are not allowed to write on /opt) and the only option to do an update for me is sudo /opt/firefox/firefox -> Help -> About Firefox and wait for the update to be downloaded and applied, then I close firefox. With this new feature has made my updates more difficult.
    – Pablo
    May 23 at 16:51










  • @earthmeLon In my case I could/should have installed firefox on my $HOME and I wouldn't need to run firefox as root for the updates. I only run FF as root like I said not for browsing but for letting FF do an auto-update.
    – Pablo
    May 23 at 16:52
















  • Try to copy the xauthority file to /home/root directory.
    – kukulo
    May 16 at 16:47










  • @kukulo its not working.
    – Harrish Kumar
    May 16 at 17:03






  • 4




    You shouldn't be running things as root. You've probably heard that before, but you really shouldn't be running a browser as root. Have you tried with any other users? What problem are you trying to solve by running as root to begin with?
    – earthmeLon
    May 16 at 18:50











  • @earthmeLon I know I know, but sometimes there are legit resons for that, in my case because I run debian 8 at my workplace and I want to have the latest firefox version, I downloaded firefox from the website and installed in /opt/firefox. As a user I am not able to do updated (because users are not allowed to write on /opt) and the only option to do an update for me is sudo /opt/firefox/firefox -> Help -> About Firefox and wait for the update to be downloaded and applied, then I close firefox. With this new feature has made my updates more difficult.
    – Pablo
    May 23 at 16:51










  • @earthmeLon In my case I could/should have installed firefox on my $HOME and I wouldn't need to run firefox as root for the updates. I only run FF as root like I said not for browsing but for letting FF do an auto-update.
    – Pablo
    May 23 at 16:52















Try to copy the xauthority file to /home/root directory.
– kukulo
May 16 at 16:47




Try to copy the xauthority file to /home/root directory.
– kukulo
May 16 at 16:47












@kukulo its not working.
– Harrish Kumar
May 16 at 17:03




@kukulo its not working.
– Harrish Kumar
May 16 at 17:03




4




4




You shouldn't be running things as root. You've probably heard that before, but you really shouldn't be running a browser as root. Have you tried with any other users? What problem are you trying to solve by running as root to begin with?
– earthmeLon
May 16 at 18:50





You shouldn't be running things as root. You've probably heard that before, but you really shouldn't be running a browser as root. Have you tried with any other users? What problem are you trying to solve by running as root to begin with?
– earthmeLon
May 16 at 18:50













@earthmeLon I know I know, but sometimes there are legit resons for that, in my case because I run debian 8 at my workplace and I want to have the latest firefox version, I downloaded firefox from the website and installed in /opt/firefox. As a user I am not able to do updated (because users are not allowed to write on /opt) and the only option to do an update for me is sudo /opt/firefox/firefox -> Help -> About Firefox and wait for the update to be downloaded and applied, then I close firefox. With this new feature has made my updates more difficult.
– Pablo
May 23 at 16:51




@earthmeLon I know I know, but sometimes there are legit resons for that, in my case because I run debian 8 at my workplace and I want to have the latest firefox version, I downloaded firefox from the website and installed in /opt/firefox. As a user I am not able to do updated (because users are not allowed to write on /opt) and the only option to do an update for me is sudo /opt/firefox/firefox -> Help -> About Firefox and wait for the update to be downloaded and applied, then I close firefox. With this new feature has made my updates more difficult.
– Pablo
May 23 at 16:51












@earthmeLon In my case I could/should have installed firefox on my $HOME and I wouldn't need to run firefox as root for the updates. I only run FF as root like I said not for browsing but for letting FF do an auto-update.
– Pablo
May 23 at 16:52




@earthmeLon In my case I could/should have installed firefox on my $HOME and I wouldn't need to run firefox as root for the updates. I only run FF as root like I said not for browsing but for letting FF do an auto-update.
– Pablo
May 23 at 16:52










1 Answer
1






active

oldest

votes

















up vote
2
down vote













earthmeLon's warning is very important, and you should try to solve your problem without having to run Firefox as root.



However, if for some reason you really need to do that (I won't judge you), you can do this:



sudo -i


To start a root shell, then make a backup of root's .Xauthority if needed



test -f .Xauthority && mv .Xauthority .Xauthority.bak


Copy the file from your home to root's



cp -a /home/youruser/.Xauthority .Xauthority
chown root: .Xauthority


Then you can start Firefox with:



XAUTHORITY=/root/.Xauthority sudo firefox


Remember to exit the root shell when you've finished with it.



Also remember to unroll your .Xauthority backup when done:



sudo -i
test -f .Xauthority.bak && mv .Xauthority.bak .Xauthority
exit





share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1037052%2frunning-firefox-as-root-in-a-regular-users-session-is-not-supported-xauthori%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    earthmeLon's warning is very important, and you should try to solve your problem without having to run Firefox as root.



    However, if for some reason you really need to do that (I won't judge you), you can do this:



    sudo -i


    To start a root shell, then make a backup of root's .Xauthority if needed



    test -f .Xauthority && mv .Xauthority .Xauthority.bak


    Copy the file from your home to root's



    cp -a /home/youruser/.Xauthority .Xauthority
    chown root: .Xauthority


    Then you can start Firefox with:



    XAUTHORITY=/root/.Xauthority sudo firefox


    Remember to exit the root shell when you've finished with it.



    Also remember to unroll your .Xauthority backup when done:



    sudo -i
    test -f .Xauthority.bak && mv .Xauthority.bak .Xauthority
    exit





    share|improve this answer


























      up vote
      2
      down vote













      earthmeLon's warning is very important, and you should try to solve your problem without having to run Firefox as root.



      However, if for some reason you really need to do that (I won't judge you), you can do this:



      sudo -i


      To start a root shell, then make a backup of root's .Xauthority if needed



      test -f .Xauthority && mv .Xauthority .Xauthority.bak


      Copy the file from your home to root's



      cp -a /home/youruser/.Xauthority .Xauthority
      chown root: .Xauthority


      Then you can start Firefox with:



      XAUTHORITY=/root/.Xauthority sudo firefox


      Remember to exit the root shell when you've finished with it.



      Also remember to unroll your .Xauthority backup when done:



      sudo -i
      test -f .Xauthority.bak && mv .Xauthority.bak .Xauthority
      exit





      share|improve this answer
























        up vote
        2
        down vote










        up vote
        2
        down vote









        earthmeLon's warning is very important, and you should try to solve your problem without having to run Firefox as root.



        However, if for some reason you really need to do that (I won't judge you), you can do this:



        sudo -i


        To start a root shell, then make a backup of root's .Xauthority if needed



        test -f .Xauthority && mv .Xauthority .Xauthority.bak


        Copy the file from your home to root's



        cp -a /home/youruser/.Xauthority .Xauthority
        chown root: .Xauthority


        Then you can start Firefox with:



        XAUTHORITY=/root/.Xauthority sudo firefox


        Remember to exit the root shell when you've finished with it.



        Also remember to unroll your .Xauthority backup when done:



        sudo -i
        test -f .Xauthority.bak && mv .Xauthority.bak .Xauthority
        exit





        share|improve this answer














        earthmeLon's warning is very important, and you should try to solve your problem without having to run Firefox as root.



        However, if for some reason you really need to do that (I won't judge you), you can do this:



        sudo -i


        To start a root shell, then make a backup of root's .Xauthority if needed



        test -f .Xauthority && mv .Xauthority .Xauthority.bak


        Copy the file from your home to root's



        cp -a /home/youruser/.Xauthority .Xauthority
        chown root: .Xauthority


        Then you can start Firefox with:



        XAUTHORITY=/root/.Xauthority sudo firefox


        Remember to exit the root shell when you've finished with it.



        Also remember to unroll your .Xauthority backup when done:



        sudo -i
        test -f .Xauthority.bak && mv .Xauthority.bak .Xauthority
        exit






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jul 24 at 22:06









        Zanna

        47.9k13117227




        47.9k13117227










        answered May 23 at 17:08









        Pablo

        1213




        1213






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1037052%2frunning-firefox-as-root-in-a-regular-users-session-is-not-supported-xauthori%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491