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 ~]#
Printable View
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 ~]#
I'm Facing the same problem. I get the following Message while trying to access gedit as root.
But gedit works with sudo command from normal user.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]#
The above shell command works fine.Code:[pradeep@localhost ~]$ sudo gedit
[sudo] password for pradeep:
[pradeep@localhost ~]$
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.
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?
@Rubberman: Well explained!! Thank you.
Using Linux everyday is more and more interesting!