Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Graphical sudo

  1. #1
    Join Date
    Jul 2005
    Beans
    412

    Graphical sudo

    Hello,

    Isn't there supposed to be some other command other than sudo which should be used when launching graphical commands with admin privileges? Which one is that? Please give me the ones for both ubuntu and kubuntu. Why should we use those commands rather than sudo for graphical applications?

  2. #2
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,803

    Re: Graphical sudo

    Quote Originally Posted by jsvidyad View Post
    Hello,

    Isn't there supposed to be some other command other than sudo which should be used when launching graphical commands with admin privileges? Which one is that? Please give me the ones for both ubuntu and kubuntu. Why should we use those commands rather than sudo for graphical applications?
    gksudo

    and kdesudo

    https://help.ubuntu.com/community/Ro...Graphical_sudo
    Feel Free to Bitcoin Tip: 135Rp4pwwYTHEJ4u8bxKaDQiC91N9LUoV2

    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  3. #3
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Graphical sudo

    gksu and gksudo are not installed as part of a default raring install,though they are in the repositories. In 12.04 at least gksudo was just a symbolic link to gksu.
    gksu can be installed on 13.04 with and it will work.
    Code:
    sudo apt-get install gksu
    Apparently its use is not recommended any more and it may be removed entirely from future issues of Ubuntu. In the long term pkexec is preferred, it allows an authorized user to execute program as another user. If the username is not specified, then the program will be executed as the administrative super user, root.
    See the man page man pkexec for more information.

  4. #4
    Join Date
    Sep 2012
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Graphical sudo

    For Ubuntu prior to 13.04 use gksu for 13.04 you can install gksu or follow the instructions here

    http://askubuntu.com/questions/28430.../284717#284717

    There may be an issue with 64-bit raring that your password does not work and you have to run gksu-properties once to change the mode from su to sudo.

    However, that was in at least one on the beta releases and may have been fixed in the final release.

  5. #5
    Join Date
    Dec 2005
    Location
    Western Australia
    Beans
    11,478
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Graphical sudo

    Quote Originally Posted by jsvidyad View Post
    Why should we use those commands rather than sudo for graphical applications?
    For KDE, the command used to be "kdesu" - it might still be.

    The reason to use those instead of sudo for graphical applications is all down to the effect on the .Xauthority file. If you use 'sudo' for graphical programs, there's a risk of it modifying the permissions or ownership of the .Xauthority file and causing you to be unable to log in next time (until you fix the permissions).
    I try to treat the cause, not the symptom. I avoid the terminal in instructions, unless it's easier or necessary. My instructions will work within the Ubuntu system, instead of breaking or subverting it. Those are the three guarantees to the helpee.

  6. #6
    Join Date
    Sep 2012
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Graphical sudo

    When you use sudo you have elevated privileges but $PATH and $HOME are yours
    When you use gksu you have elevated privileges and $PATH and $HOME are those of root

    Normally it does not matter which you use but it can mean config files get written in the wrong place or owned by the wrong person. This can cause problems.

    The advice has always been use gksu or gksudo (,kdesu on kde) with graphical programs because it's always OK. It's easier than trying to explain which programs need gksu and which can use either.

    This web page explains it better : http://www.psychocats.net/ubuntu/graphicalsudo

    With raring you can use gksu but it's not installed by default, because the developers would rather we used policy-kit to set things up but its not easy to use yet.

    To install gksu

    Code:
    sudo apt-get gksu
    then possibly -- once only

    Code:
    gksu-properties
    make sure authentication is set to sudo. You wont need to run gksu-properties again.

    This was necessary on 64-bit Ubuntu in the beta2 release but not 32-bit. Haven't tested the final release yet so it may or may not be neccesary


    The other way is to open a terminal and enter

    Code:
    sudo -i
    Inside that terminal you are root so you can run the programs as root without problem: by typing the name of the program in that terminal. Do not close the terminal until you are finished however as it will kill the program you want to run.
    Last edited by Warren Hill; April 27th, 2013 at 11:33 AM. Reason: Corrrected instruction gksu-properties, was gksu-policy (Thanks coffeecat for pointing that out)

  7. #7
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Graphical sudo

    Quote Originally Posted by slickymaster View Post
    gksu and gksudo are not installed as part of a default raring install,though they are in the repositories. In 12.04 at least gksudo was just a symbolic link to gksu.
    gksu can be installed on 13.04 with and it will work.
    Code:
    sudo apt-get install gksu
    Apparently its use is not recommended any more and it may be removed entirely from future issues of Ubuntu. In the long term pkexec is preferred, it allows an authorized user to execute program as another user. If the username is not specified, then the program will be executed as the administrative super user, root.
    See the man page man pkexec for more information.
    So pkexec will replace gksu(do). Just like that, or are there any implications for a regular user other than a new name?

  8. #8
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Graphical sudo

    Quote Originally Posted by Warren Hill View Post
    To install gksu

    Code:
    sudo apt-get gksu
    then possibly -- once only

    Code:
    gksu-policy
    make sure authentication is set to sudo. You wont need to run gksu-policy again.

    This was necessary on 64-bit Ubuntu in the beta2 release but not 32-bit. Haven't tested the final release yet so it may or may not be neccesary
    I think you mean "gksu-properties", not "gksu-policy" to set sudo mode.

    I've found something interesting in my 24-hour old shiny new 64-bit Raring installation. I have gksu installed although I didn't deliberately install it myself. I think it was installed as a recommends of synaptic which is always the first thing I install after an apt-get update in a fresh Ubuntu installation. I must admit I wasn't paying much attention to the terminal feedback when installing synaptic - I tend to be on autopilot at this point, shame on me! Whichever - I had to run gksu-properties to change from su mode to sudo mode.

    EDIT - for the record: Checking on a fresh newer installation - it was hplip-gui that brought in gksu as a dependency.
    Last edited by coffeecat; April 27th, 2013 at 11:49 AM.

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  9. #9
    Join Date
    Sep 2012
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Graphical sudo

    Quote Originally Posted by coffeecat View Post
    I think you mean "gksu-properties", not "gksu-policy" to set sudo mode.

    I've found something interesting in my 24-hour old shiny new 64-bit Raring installation. I have gksu installed although I didn't deliberately install it myself. I think it was installed as a recommends of synaptic which is always the first thing I install after an apt-get update in a fresh Ubuntu installation. I must admit I wasn't paying much attention to the terminal feedback when installing synaptic - I tend to be on autopilot at this point, shame on me! Whichever - I had to run gksu-properties to change from su mode to sudo mode.
    Thanks for the correction. Yes I did mean gksu-properties.

  10. #10
    Join Date
    Sep 2012
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Graphical sudo

    Quote Originally Posted by sudodus View Post
    So pkexec will replace gksu(do). Just like that, or are there any implications for a regular user other than a new name?
    pkexec is not just a new name For example

    Code:
    gksu nautilus
    runs the file manager as root while


    Code:
    pkexec nautilus
    Doesn't work.

    pkexec is a front end to policy-kit which aims at being a more fine grained tool for controlling rights and privileges than sudo and gksu. More needs to be set-up and it's not all in place yet to be an easy tool the casual user.

    For now I recommend you either install gksu (setting the Authentication mode to sudo if required) or type
    Code:
    sudo -i
    in a terminal and run GUI applications that you want to run as root from inside that terminal.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •