Announcement

Collapse
No announcement yet.

Avoid a KDEctomy: Musings on sudo and kdesudo

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Avoid a KDEctomy: Musings on sudo and kdesudo

    I don't think so. Launching any GUI app with kdesudo preserves the users environment. There are some quirks (by design?) where you need/must launch a System Settings module 'as root' in order for changes to be preserved between reboots. That's why I suggested this approach. If it works, it works. If it doesn't, then there is some other issue as the root cause (no pun intended) of the OP's problem.
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    #2
    Originally posted by Snowhog View Post
    I don't think so. Launching any GUI app with kdesudo preserves the users environment. There are some quirks (by design?) where you need/must launch a System Settings module 'as root' in order for changes to be preserved between reboots. That's why I suggested this approach. If it works, it works. If it doesn't, then there is some other issue as the root cause (no pun intended) of the OP's problem.
    No, it uses roots environment:

    Code:
    kdesudo konsole
    # echo $HOME
    /root
    So all settings are saved to /root rather then your home and you cannot read roots settings. Some dialogs are designed to affect system settings when run as root (such as the grub one) but phonon is only meant to be run as a normal user.

    Comment


      #3
      I stand corrected.
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        Musings on sudo and kdesudo

        Inconsistencies...

        Code:
        steve@t520:~$ [B]whoami[/B]
        steve
        
        steve@t520:~$ [B]echo $HOME[/B]
        /home/steve
        
        steve@t520:~$ [B]pwd[/B]
        /home/steve
        
        steve@t520:~$ [B]sudo konsole[/B]
        
        root@t520:~# [B]whoami[/B]
        root
        
        root@t520:~# [B]echo $HOME[/B]
        /home/steve
        
        root@t520:~# [B]pwd[/B]
        /home/steve
        
        root@t520:~# [B]exit[/B]
        
        steve@t520:~$ [B]kdesudo konsole[/B]
        
        root@t520:/home/steve# [B]whoami[/B]
        root
        
        root@t520:/home/steve# [B]echo $HOME[/B]
        /root
        
        root@t520:/home/steve# [B]pwd[/B]
        /home/steve
        
        root@t520:/home/steve# [B]exit[/B]
        steve@t520:~$

        Comment


          #5
          Originally posted by SteveRiley
          Inconsistencies...
          That's basically the reason why one should run GUI apps with kdesudo rather than sudo (sudo by default, and as configured in *buntus, doesn't fully change to root environment)

          Comment


            #6
            Yeah, the difference lies in the value of $HOME. This is also interesting, to see how $XAUTHORITY changes.

            Code:
            steve@t520:~$ [B]sudo env[/B]
            TERM=xterm
            LS_COLORS={...snipped...}
            PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
            LANG=en_US.UTF-8
            HOME=/home/steve
            LANGUAGE=
            DISPLAY=:0
            XAUTHORITY=/tmp/kde-steve/xauth-1000-_0
            SHELL=/bin/bash
            LOGNAME=root
            USER=root
            USERNAME=root
            MAIL=/var/mail/root
            SUDO_COMMAND=/usr/bin/env
            SUDO_USER=steve
            SUDO_UID=1000
            SUDO_GID=1000
            
            steve@t520:~$ [B]kdesudo env[/B]
            LANGUAGE=
            PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
            LANG=en_US.UTF-8
            DISPLAY=:0
            XAUTHORITY=/tmp/kdesudo-Z27358-xauth
            TERM=xterm
            LS_COLORS={...snipped...}
            HOME=/root
            SHELL=/bin/bash
            LOGNAME=root
            USER=root
            USERNAME=root
            MAIL=/var/mail/root
            SUDO_COMMAND=/usr/bin/env
            SUDO_USER=steve
            SUDO_UID=1000
            SUDO_GID=1000

            Comment


              #7
              Right -- when ~/.Xauthority becomes owned by root, as a result of "sudo kate" or something like that, the user is done logging in to KDE. A painful lesson learned the hard way by many a Kubuntu user, including yours truly.

              Comment


                #8
                Originally posted by dibl
                the user is done logging in to KDE
                Yawp, I've experienced the same KDEctomy myself!

                Comment


                  #9
                  Originally posted by SteveRiley
                  Yeah, the difference lies in the value of $HOME.
                  That's the difference that commonly creates the most "havoc", but not the only one.

                  One can run GUI apps with sudo using root's $HOME, but that usually requires a bit of tinkering, something like (but not limited to):
                  sudo -H XAUTHORITY=$HOME/.Xauthority konsole

                  Then again, this has very little to do with the topic at hand, and probably belongs in another topic

                  Comment


                    #10
                    Originally posted by dibl
                    Right -- when ~/.Xauthority becomes owned by root, as a result of "sudo kate" or something like that, the user is done logging in to KDE. A painful lesson learned the hard way by many a Kubuntu user, including yours truly.
                    Hmm...I don't think running 'sudo kate' should change the .Xauthority ownership (kate configs and caches are another matter)...something like sudo startx probably could.
                    (I'll admit I'm not 100% on that, though, I don't use sudo like that so I don't really have empirical evidence)

                    Perhaps mod could split us thread privateers onto a new thread, so we don't mask the OP's problem?

                    Comment


                      #11
                      Moved. Snowhog actually beat me to it, but then his disappeared into the mod pit

                      Comment


                        #12
                        well, if one READS all the info provided in the little black box thingy and LOOKS at where one is in the pathway then one will know if one is going to be hoist on one's own sudopetard.

                        lol

                        woodsmoke

                        Comment


                          #13
                          He's ba-a-a-ack!
                          Windows no longer obstructs my view.
                          Using Kubuntu Linux since March 23, 2007.
                          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                          Comment


                            #14
                            Originally posted by woodsmoke View Post
                            sudopetard
                            Is that anything like a pseudopetard? Or more like a sudopicard?

                            Comment


                              #15
                              Potato, patato. You say Amond, I say almond.
                              Windows no longer obstructs my view.
                              Using Kubuntu Linux since March 23, 2007.
                              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                              Comment

                              Working...
                              X