Edit a root file in a GUI live system [duplicate]












0















This question already has an answer here:




  • I need an equivalent of gksu in 18.04

    4 answers




I need to inspect and repair a Raspberry Pi SD card. This is my main goal. And it should be as simple as possible. It's already bad enough that Windows 10 cannot mount that file system and Android also has no idea about it (but creates random junk on the volume it understands). So I got an Ubuntu disk image and started the live system in VMware. I thought this should be the easiest and quickest solution to get to an environment that can handle a Linux file system.



I plugged in the card reader and it showed up as two volumes on the Ubuntu live desktop as expected. But the file I need to edit belongs to root. The default graphical text editor (it has no visible name) that is started from the default graphical file explorer (also has no visible name) only opens the file as read-only. Saving is not possible.



Smart Windows applications ask me for the required privileges when I want to use them. (Dumb Windows applications still don't.) I thought Linux apps were that smart before. But the editor isn't.



So what are my options to edit that file?



Is going to a terminal and using all the funny text UI tools all I can do now? I'd really prefer a GUI solution because I always forget terminal commands after not using them for a month. And the mount path seems to be unreadable for humans, it's so long I can't see it completely. I found the command gksudo nautilus somewhere around but it's not available on my system.










share|improve this question













marked as duplicate by karel, Elder Geek, Eric Carvalho, Thomas, Charles Green 8 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.




















    0















    This question already has an answer here:




    • I need an equivalent of gksu in 18.04

      4 answers




    I need to inspect and repair a Raspberry Pi SD card. This is my main goal. And it should be as simple as possible. It's already bad enough that Windows 10 cannot mount that file system and Android also has no idea about it (but creates random junk on the volume it understands). So I got an Ubuntu disk image and started the live system in VMware. I thought this should be the easiest and quickest solution to get to an environment that can handle a Linux file system.



    I plugged in the card reader and it showed up as two volumes on the Ubuntu live desktop as expected. But the file I need to edit belongs to root. The default graphical text editor (it has no visible name) that is started from the default graphical file explorer (also has no visible name) only opens the file as read-only. Saving is not possible.



    Smart Windows applications ask me for the required privileges when I want to use them. (Dumb Windows applications still don't.) I thought Linux apps were that smart before. But the editor isn't.



    So what are my options to edit that file?



    Is going to a terminal and using all the funny text UI tools all I can do now? I'd really prefer a GUI solution because I always forget terminal commands after not using them for a month. And the mount path seems to be unreadable for humans, it's so long I can't see it completely. I found the command gksudo nautilus somewhere around but it's not available on my system.










    share|improve this question













    marked as duplicate by karel, Elder Geek, Eric Carvalho, Thomas, Charles Green 8 hours ago


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















      0












      0








      0








      This question already has an answer here:




      • I need an equivalent of gksu in 18.04

        4 answers




      I need to inspect and repair a Raspberry Pi SD card. This is my main goal. And it should be as simple as possible. It's already bad enough that Windows 10 cannot mount that file system and Android also has no idea about it (but creates random junk on the volume it understands). So I got an Ubuntu disk image and started the live system in VMware. I thought this should be the easiest and quickest solution to get to an environment that can handle a Linux file system.



      I plugged in the card reader and it showed up as two volumes on the Ubuntu live desktop as expected. But the file I need to edit belongs to root. The default graphical text editor (it has no visible name) that is started from the default graphical file explorer (also has no visible name) only opens the file as read-only. Saving is not possible.



      Smart Windows applications ask me for the required privileges when I want to use them. (Dumb Windows applications still don't.) I thought Linux apps were that smart before. But the editor isn't.



      So what are my options to edit that file?



      Is going to a terminal and using all the funny text UI tools all I can do now? I'd really prefer a GUI solution because I always forget terminal commands after not using them for a month. And the mount path seems to be unreadable for humans, it's so long I can't see it completely. I found the command gksudo nautilus somewhere around but it's not available on my system.










      share|improve this question














      This question already has an answer here:




      • I need an equivalent of gksu in 18.04

        4 answers




      I need to inspect and repair a Raspberry Pi SD card. This is my main goal. And it should be as simple as possible. It's already bad enough that Windows 10 cannot mount that file system and Android also has no idea about it (but creates random junk on the volume it understands). So I got an Ubuntu disk image and started the live system in VMware. I thought this should be the easiest and quickest solution to get to an environment that can handle a Linux file system.



      I plugged in the card reader and it showed up as two volumes on the Ubuntu live desktop as expected. But the file I need to edit belongs to root. The default graphical text editor (it has no visible name) that is started from the default graphical file explorer (also has no visible name) only opens the file as read-only. Saving is not possible.



      Smart Windows applications ask me for the required privileges when I want to use them. (Dumb Windows applications still don't.) I thought Linux apps were that smart before. But the editor isn't.



      So what are my options to edit that file?



      Is going to a terminal and using all the funny text UI tools all I can do now? I'd really prefer a GUI solution because I always forget terminal commands after not using them for a month. And the mount path seems to be unreadable for humans, it's so long I can't see it completely. I found the command gksudo nautilus somewhere around but it's not available on my system.





      This question already has an answer here:




      • I need an equivalent of gksu in 18.04

        4 answers








      root live-cd text-editor






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      ygoe

      1628




      1628




      marked as duplicate by karel, Elder Geek, Eric Carvalho, Thomas, Charles Green 8 hours ago


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






      marked as duplicate by karel, Elder Geek, Eric Carvalho, Thomas, Charles Green 8 hours ago


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          3 Answers
          3






          active

          oldest

          votes


















          2















          gksu was the program that provided a GTK frontend for su and sudo. This way graphical applications were allowed to be run with root privileges.
          gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.




          So, instead of using:



          gksudo nautilus


          Use:



          sudo -H nautilus


          or



          nautilus admin://





          share|improve this answer





























            0














            The text editor kate let's you edit and save files you don't have write permissions on by entering the sudo password. Since in a live system there is no sudo password (i.e. you can sudo without providing a password), it won't even ask for it, so you can just save all files regardless of the write permissions.



            You can install kate in the Ubuntu live system (after enabling the online repositories), but it would be lost on shutdown/reboot.



            If you are comfortable with using a different Ubuntu flavour, you can try Kubuntu, which comes with kate pre-installed as the default text editor.






            share|improve this answer





























              0














              The standard GUI editor in Ubuntu is gedit, and you can run it with elevated permissions with



              sudo -H gedit name-of-file               # when in the current directory
              sudo -H gedit path/to/file


              for example



              sudo -H gedit /etc/fstab




              If you run Wayland (instead of Xorg), you need xhosts too in order to allow the superuser root to access the graphical user environment,



              xhost +si:localuser:root


              and after that you can run sudo -H .... See this link:



              Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland?




              A good (and safe) alternative is the following command line with the gvfs admin backend.



              gedit admin:///path/to/file  # you need the full path (starting with 3 slashes)


              for example



              gedit admin:///etc/fstab


              The gvfs admin backend works only with application programs, that
              are prepared to work with it (Ubuntu's editor gedit and file browser
              nautilus are two of them).



              In Ubuntu 18.04 LTS, when started from nautilus admin://, gedit will automatically use
              the gvfs admin backend (and you will be asked for a password so that you can edit files owned by root).






              However, I can recommend using text mode tools for tasks that need elevated permissions, in this case the editor nano,



              sudo nano name-of-file
              sudo nano path/to/file


              for example



              sudo nano /etc/fstab





              share|improve this answer






























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                2















                gksu was the program that provided a GTK frontend for su and sudo. This way graphical applications were allowed to be run with root privileges.
                gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.




                So, instead of using:



                gksudo nautilus


                Use:



                sudo -H nautilus


                or



                nautilus admin://





                share|improve this answer


























                  2















                  gksu was the program that provided a GTK frontend for su and sudo. This way graphical applications were allowed to be run with root privileges.
                  gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.




                  So, instead of using:



                  gksudo nautilus


                  Use:



                  sudo -H nautilus


                  or



                  nautilus admin://





                  share|improve this answer
























                    2












                    2








                    2







                    gksu was the program that provided a GTK frontend for su and sudo. This way graphical applications were allowed to be run with root privileges.
                    gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.




                    So, instead of using:



                    gksudo nautilus


                    Use:



                    sudo -H nautilus


                    or



                    nautilus admin://





                    share|improve this answer













                    gksu was the program that provided a GTK frontend for su and sudo. This way graphical applications were allowed to be run with root privileges.
                    gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.




                    So, instead of using:



                    gksudo nautilus


                    Use:



                    sudo -H nautilus


                    or



                    nautilus admin://






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered yesterday









                    Kulfy

                    3,27531039




                    3,27531039

























                        0














                        The text editor kate let's you edit and save files you don't have write permissions on by entering the sudo password. Since in a live system there is no sudo password (i.e. you can sudo without providing a password), it won't even ask for it, so you can just save all files regardless of the write permissions.



                        You can install kate in the Ubuntu live system (after enabling the online repositories), but it would be lost on shutdown/reboot.



                        If you are comfortable with using a different Ubuntu flavour, you can try Kubuntu, which comes with kate pre-installed as the default text editor.






                        share|improve this answer


























                          0














                          The text editor kate let's you edit and save files you don't have write permissions on by entering the sudo password. Since in a live system there is no sudo password (i.e. you can sudo without providing a password), it won't even ask for it, so you can just save all files regardless of the write permissions.



                          You can install kate in the Ubuntu live system (after enabling the online repositories), but it would be lost on shutdown/reboot.



                          If you are comfortable with using a different Ubuntu flavour, you can try Kubuntu, which comes with kate pre-installed as the default text editor.






                          share|improve this answer
























                            0












                            0








                            0






                            The text editor kate let's you edit and save files you don't have write permissions on by entering the sudo password. Since in a live system there is no sudo password (i.e. you can sudo without providing a password), it won't even ask for it, so you can just save all files regardless of the write permissions.



                            You can install kate in the Ubuntu live system (after enabling the online repositories), but it would be lost on shutdown/reboot.



                            If you are comfortable with using a different Ubuntu flavour, you can try Kubuntu, which comes with kate pre-installed as the default text editor.






                            share|improve this answer












                            The text editor kate let's you edit and save files you don't have write permissions on by entering the sudo password. Since in a live system there is no sudo password (i.e. you can sudo without providing a password), it won't even ask for it, so you can just save all files regardless of the write permissions.



                            You can install kate in the Ubuntu live system (after enabling the online repositories), but it would be lost on shutdown/reboot.



                            If you are comfortable with using a different Ubuntu flavour, you can try Kubuntu, which comes with kate pre-installed as the default text editor.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered yesterday









                            danzel

                            1,627712




                            1,627712























                                0














                                The standard GUI editor in Ubuntu is gedit, and you can run it with elevated permissions with



                                sudo -H gedit name-of-file               # when in the current directory
                                sudo -H gedit path/to/file


                                for example



                                sudo -H gedit /etc/fstab




                                If you run Wayland (instead of Xorg), you need xhosts too in order to allow the superuser root to access the graphical user environment,



                                xhost +si:localuser:root


                                and after that you can run sudo -H .... See this link:



                                Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland?




                                A good (and safe) alternative is the following command line with the gvfs admin backend.



                                gedit admin:///path/to/file  # you need the full path (starting with 3 slashes)


                                for example



                                gedit admin:///etc/fstab


                                The gvfs admin backend works only with application programs, that
                                are prepared to work with it (Ubuntu's editor gedit and file browser
                                nautilus are two of them).



                                In Ubuntu 18.04 LTS, when started from nautilus admin://, gedit will automatically use
                                the gvfs admin backend (and you will be asked for a password so that you can edit files owned by root).






                                However, I can recommend using text mode tools for tasks that need elevated permissions, in this case the editor nano,



                                sudo nano name-of-file
                                sudo nano path/to/file


                                for example



                                sudo nano /etc/fstab





                                share|improve this answer




























                                  0














                                  The standard GUI editor in Ubuntu is gedit, and you can run it with elevated permissions with



                                  sudo -H gedit name-of-file               # when in the current directory
                                  sudo -H gedit path/to/file


                                  for example



                                  sudo -H gedit /etc/fstab




                                  If you run Wayland (instead of Xorg), you need xhosts too in order to allow the superuser root to access the graphical user environment,



                                  xhost +si:localuser:root


                                  and after that you can run sudo -H .... See this link:



                                  Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland?




                                  A good (and safe) alternative is the following command line with the gvfs admin backend.



                                  gedit admin:///path/to/file  # you need the full path (starting with 3 slashes)


                                  for example



                                  gedit admin:///etc/fstab


                                  The gvfs admin backend works only with application programs, that
                                  are prepared to work with it (Ubuntu's editor gedit and file browser
                                  nautilus are two of them).



                                  In Ubuntu 18.04 LTS, when started from nautilus admin://, gedit will automatically use
                                  the gvfs admin backend (and you will be asked for a password so that you can edit files owned by root).






                                  However, I can recommend using text mode tools for tasks that need elevated permissions, in this case the editor nano,



                                  sudo nano name-of-file
                                  sudo nano path/to/file


                                  for example



                                  sudo nano /etc/fstab





                                  share|improve this answer


























                                    0












                                    0








                                    0






                                    The standard GUI editor in Ubuntu is gedit, and you can run it with elevated permissions with



                                    sudo -H gedit name-of-file               # when in the current directory
                                    sudo -H gedit path/to/file


                                    for example



                                    sudo -H gedit /etc/fstab




                                    If you run Wayland (instead of Xorg), you need xhosts too in order to allow the superuser root to access the graphical user environment,



                                    xhost +si:localuser:root


                                    and after that you can run sudo -H .... See this link:



                                    Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland?




                                    A good (and safe) alternative is the following command line with the gvfs admin backend.



                                    gedit admin:///path/to/file  # you need the full path (starting with 3 slashes)


                                    for example



                                    gedit admin:///etc/fstab


                                    The gvfs admin backend works only with application programs, that
                                    are prepared to work with it (Ubuntu's editor gedit and file browser
                                    nautilus are two of them).



                                    In Ubuntu 18.04 LTS, when started from nautilus admin://, gedit will automatically use
                                    the gvfs admin backend (and you will be asked for a password so that you can edit files owned by root).






                                    However, I can recommend using text mode tools for tasks that need elevated permissions, in this case the editor nano,



                                    sudo nano name-of-file
                                    sudo nano path/to/file


                                    for example



                                    sudo nano /etc/fstab





                                    share|improve this answer














                                    The standard GUI editor in Ubuntu is gedit, and you can run it with elevated permissions with



                                    sudo -H gedit name-of-file               # when in the current directory
                                    sudo -H gedit path/to/file


                                    for example



                                    sudo -H gedit /etc/fstab




                                    If you run Wayland (instead of Xorg), you need xhosts too in order to allow the superuser root to access the graphical user environment,



                                    xhost +si:localuser:root


                                    and after that you can run sudo -H .... See this link:



                                    Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland?




                                    A good (and safe) alternative is the following command line with the gvfs admin backend.



                                    gedit admin:///path/to/file  # you need the full path (starting with 3 slashes)


                                    for example



                                    gedit admin:///etc/fstab


                                    The gvfs admin backend works only with application programs, that
                                    are prepared to work with it (Ubuntu's editor gedit and file browser
                                    nautilus are two of them).



                                    In Ubuntu 18.04 LTS, when started from nautilus admin://, gedit will automatically use
                                    the gvfs admin backend (and you will be asked for a password so that you can edit files owned by root).






                                    However, I can recommend using text mode tools for tasks that need elevated permissions, in this case the editor nano,



                                    sudo nano name-of-file
                                    sudo nano path/to/file


                                    for example



                                    sudo nano /etc/fstab






                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited yesterday

























                                    answered yesterday









                                    sudodus

                                    22.8k32873




                                    22.8k32873















                                        Popular posts from this blog

                                        Questions related to Moebius Transform of Characteristic Function of the Primes

                                        List of scandals in India

                                        Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?