After su to root is used in Ubuntu, the command gedit will find an error: ** (gedit: 2976): WARNING **: the connection is closed (gedit: 2976 ): eggSMClient-WARNING **: Failedtoconnecttothesessionmanager: Noneoftheauthenticationprotocolsspecifie
After su to root is used in Ubuntu, an error occurs when gedit is used:
** (Gedit: 2976): WARNING **: the connection is closed.
(Gedit: 2976): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported
** (Gedit: 2976): WARNING **: cocould not connect to session bus
The reason is:
Su Can only switch to administrator user permissions, without the Administrator's login script and search path
Su-not only can switch to administrator permissions, but also use the administrator login script and search path
Solution: After using sudo gedit or su-, there will be no error in gedit!