Find the answer to your Linux question:
Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By Rubberman
cant seem to open gedit as root but opens as a user ?? Why ?? Code: [zedan@localhost /]$ su - Password: [zedan@localhost ~]# gedit Cannot open display: Run 'gedit --help' ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2011
    Posts
    68

    cant open gedit as root ? Why ??


    cant seem to open gedit as root but opens as a user ?? Why ??
    Code:
    [zedan@localhost /]$ su -
    Password: 
    [zedan@localhost ~]# gedit
    Cannot open display: 
    Run 'gedit --help' to see a full list of available command line options.
    [root@localhost ~]#
    Last edited by zedan85; 01-12-2012 at 11:06 PM.

  2. #2
    Just Joined! pradeeprajkumar's Avatar
    Join Date
    Jun 2010
    Location
    India
    Posts
    72
    I'm Facing the same problem. I get the following Message while trying to access gedit as root.
    Code:
    [pradeep@localhost ~]$ su
    Password: 
    [root@localhost pradeep]# gedit
    
    (gedit:5431): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported
    
    g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.
    Terminated
    [root@localhost pradeep]#
    But gedit works with sudo command from normal user.
    Code:
    [pradeep@localhost ~]$ sudo gedit
    [sudo] password for pradeep: 
    [pradeep@localhost ~]$
    The above shell command works fine.

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,663
    You might find that the DISPLAY environment is not set for root. I'll bet if you did "su" and not "su -", it would work, because you would still have your previous user environment.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Oct 2011
    Posts
    68
    Didnt want to start a new thread for this but @Rubberman could you tell me the difference between su and su- ?? I am a bit confused..

  6. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,663
    Quote Originally Posted by zedan85 View Post
    Didnt want to start a new thread for this but @Rubberman could you tell me the difference between su and su- ?? I am a bit confused..
    The su command is to "switch user". By default (no user name argument) that is to root. Without the dash it tells the su command to keep the current user environment (directory and environment variables such as $PATH and $DISPLAY). With the dash it tells su to establish a login shell for the specified (or root) user, thus establishing a new environment (directory and environment variables) just like that user had freshly logged into the system. So the command "su foo" says "just change my user and group to foo's, but keep my environment. The command "su - foo" says "log me in as user foo with all of foo's environment and privileges". Leaving off foo defaults to root. Is this a bit clearer?
    pradeeprajkumar likes this.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #6
    Just Joined! pradeeprajkumar's Avatar
    Join Date
    Jun 2010
    Location
    India
    Posts
    72
    @Rubberman: Well explained!! Thank you.
    Using Linux everyday is more and more interesting!

Posting Permissions

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