Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: opening gedit using root

  1. #1
    Join Date
    Oct 2010
    Location
    Cape Town, South Africa
    Posts
    58

    Default opening gedit using root

    Whenever i try sudo gedit I get:

    Cannot open display:
    Run 'gedit --help' to see a full list of available command line options.

    I have run gedit --help and have found nothing to help me open gedit. Please let me know if I missed something or how I can open gedit as root.

  2. #2
    Join Date
    May 2011
    Location
    Derbyshire, United Kingdom
    Posts
    56

    Default Re: opening gedit using root

    Hi Kyluke,

    If you log in as root, "su" in a terminal emulator, such as the GNOME Terminal, and then once as root, type "gnomesu gedit", this should open gedit as root.

    Hope this helps

  3. #3
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,526
    Blog Entries
    37

    Default Re: opening gedit using root

    Hi Kyluke,



    A further note to this. There is actually a desktop specificity to this. If you are using gnome or KDE, then to open gedit as root you type (as a regular user):
    • if using Gnome:
      Code:
      gnomesu gedit
      .
    • if using KDE :
      Code:
      kdesu gedit
    and in both cases enter root password when prompted.

    The same is true for opening any other apps with root permissions. As a regular user, in KDE type "kdesu application" and in Gnome type "gnomesu application".

    What you may find interesting is the LXDE desktop is different. If using LXDE, you can simply first type "su" (or "su -" ) and then type the 'application' and there is no need for an lxdesu or anything like that.


    For example to open the application 'leafpad' with root permissions
    • in KDE I type: kdesu leafpad
    • in Gnome I type: gnomesu leafpad
    • in LXDE I type: su -c leafpad

    ... and I enter root password when prompted for a password.

  4. #4

    Default Re: opening gedit using root

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    gnomesu gedit

    Good luck.





    On 06/06/2011 09:06 AM, Kyluke wrote:
    >
    > Whenever i try sudo gedit I get:
    >
    > Cannot open display:
    > Run 'gedit --help' to see a full list of available command line
    > options.
    >
    > I have run gedit --help and have found nothing to help me open gedit.
    > Please let me know if I missed something or how I can open gedit as
    > root.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.15 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQIcBAEBAgAGBQJN7PPLAAoJEF+XTK08PnB5eUcQAIXJ8Pwhz6gO7G75AG8jMmAe
    UdlAKSrH5V44LPD88F1FzaKdhhxWKx80lU1KePQPZPJTKBRPTYrqHaLKe4+lkzZm
    BMUDVJ+HozvJnTOZrjgKyU5beuQLl1xeGYZJHrflTdCnGYGuH3GDXXb16CDcNkYz
    /FYBJkKQhhMoqqqn3fnGh4HVAcnI7m37zC1utBuR/HLa0kiIcJfoxvaPSpfYFwwS
    Wp/WIfZ875DFWl88+3KTpSSHavyAra2sZgRovThBaSoa8RU8QLSLGwkXfhmHHgS4
    OY34441CEJA+PZxkDK/yhRweMR2oLYwodD4Dwzpn04ih7aXE6fPYyeOrr7zt/YsG
    aAuBTD2sv2r0TK57xAMjAUXxA0euxl1b9vtxxDgHhy/I8VsNfz1ySkCy5fHep4O+
    dpJCUK15OYGe6qwmYD4HdezTvjjFI2HjHQggKsodlEuepltBJThNLimddXu4Jo70
    58nUpMzPW1Qy3XKNX5I9zMfwDB+jwgI2sELioxXKDcBGBzi7mgjedTr3bvNFjbyu
    fcFY1mu4VdGMfOEv9S/5xFn9QSBV/HD3NMs3fEp4wbBlkBYv6GTX6v3zbidUjAig
    RI1ZQh99+8JnhD0VcuZMCY/IIEc8o36wtl4mHz2eeGCrVprlOi2jVO0IpBorgOg8
    HCqD//quntAmEvi6sDL+
    =Za/5
    -----END PGP SIGNATURE-----

  5. #5
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: opening gedit using root

    On 06/06/2011 05:36 PM, DawthLasu wrote:

    > If you log in as root, "su" in a terminal emulator, such as the GNOME
    > Terminal, and then once as root, type "gnomesu gedit", this should open
    > gedit as root.


    two little problems with that information:

    1. to become root in a terminal one should use "su -" and not "su", see
    http://tinyurl.com/ydbwssh

    2. it is unnecessary to become root in the terminal prior to issuing
    "gnomesu gedit"....that entered into a user terminal will prompt a popup
    asking for the root password, and if that successful gedit will open
    with root powers... see

    --
    dd CAVEAT: http://is.gd/bpoMD
    via NNTP openSUSE 11.4 [2.6.37.6-0.5] + KDE 4.6.0 + Thunderbird 3.1.10
    Acer Aspire One D255, 1.66 GHz Atom, 1 GB RAM, Intel Pineview graphics
    * When your gecko is broken you have a reptile dysfunction! *

  6. #6
    Join Date
    Oct 2010
    Location
    Cape Town, South Africa
    Posts
    58

    Default AW: opening gedit using root

    AAH thank you so much guys!!

  7. #7
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: opening gedit using root

    oldcpu wrote:
    > - in LXDE I type: su -c leafpad

    There is also a very generic desktop independent xdg-su from the package
    xdg-utils (for graphical applications), the benefit (if it is one) compared
    to su is it opens a graphical password dialog, so you need no terminal and
    it can directly be used with [ALT] [F2].

    --
    PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.3 | GeForce
    9600 GT | 4GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.0 | nVidia
    ION | 3GB Ram

  8. #8

    Default Re: opening gedit using root

    DenverD wrote:
    > On 06/06/2011 05:36 PM, DawthLasu wrote:
    >
    >> If you log in as root, "su" in a terminal emulator, such as the GNOME
    >> Terminal, and then once as root, type "gnomesu gedit", this should open
    >> gedit as root.

    >
    > two little problems with that information:
    >
    > 1. to become root in a terminal one should use "su -" and not "su", see
    > http://tinyurl.com/ydbwssh
    >
    > 2. it is unnecessary to become root in the terminal prior to issuing
    > "gnomesu gedit"....that entered into a user terminal will prompt a popup
    > asking for the root password, and if that successful gedit will open
    > with root powers... see


    Plus the first large problem:

    0. log in as root - NO, NO, NO

  9. #9
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: opening gedit using root

    On 06/06/2011 05:46 PM, martin_helm wrote:
    > There is also a very generic desktop independent xdg-su from the package
    > xdg-utils (for graphical applications), the benefit (if it is one) compared
    > to su is it opens a graphical password dialog, so you need no terminal and
    > it can directly be used with [ALT] [F2].



    as can both kdesu and gnomesu thusly:

    1. alt+F2
    2. type for example "kdesu kwrite" or "gnomesu gedit"
    3. type root password into GUI password dialog
    4. kwrite/gedit opens (no terminal required)

    and, now there is a third way to be entered onto line two above:

    xdg-su -c [kwrite/gedit/etc]

    which is only half again as long (four key strokes longer than kdesu)
    for kde, but only two more strokes than gnomesu

    --
    dd CAVEAT: http://is.gd/bpoMD
    via NNTP openSUSE 11.4 [2.6.37.6-0.5] + KDE 4.6.0 + Thunderbird 3.1.10
    Acer Aspire One D255, 1.66 GHz Atom, 1 GB RAM, Intel Pineview graphics
    * When your gecko is broken you have a reptile dysfunction! *

  10. #10
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: opening gedit using root

    DenverD wrote:
    > as can both kdesu and gnomesu

    which you don't need on a plain x11/openbox/fluxbox/lxde for example, that
    was my point just to make it more clear (of course you can install kdesu or
    gnomesu there but it makes not too much sense to install something with more
    dependencies if you have already a tool which does the same job without
    additional dependencies).
    On kde of course I use kdesu not xdg-su -c.

    --
    PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.3 | GeForce
    9600 GT | 4GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.0 | nVidia
    ION | 3GB Ram

Page 1 of 3 123 LastLast

Posting Permissions

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