I need to change the hostname of my Computer from localhost.localdomain
to DESKTOP
. However, I can't manage to do this, even after browsing some of the net.
I've changed my hostname with hostname DESKTOP
The best informations I've found so far as in there : https://stackoverflow.com/questions/20611783/after-changing-hostname-gedit-not-open
However, once my hostname is changed to DESKTOP
, I can't access gedit
or any other thing that are IHM-linked in my terminal, as a root user. Which I need to do.
$ xauth list
xauth : file /root/.Xauthority does not exist
I can't get to add something to xauth
, I've tried to type this:
$ xauth add ${DESKTOP}/unix:0 . [Same key as in xauth list as normal user]
Which gives me:
$ xauth: (argv):1: bad display name "/unix:0" in "add" command
Is there a way to get this to work? I'm on the same machine, I don't use SSH.
Oddly, I seem to be able to use gedit
if I use sudo -i
to log as sudo
. But why? And how can I get to work permanently with su
to log?
hostname DESKTOP
. I can't access your link, there is an error, could you check it ? – Anonymous12223 Aug 22 '14 at 13:51127.0.0.1 [your hostname]
to /etc/hosts. – Renan Aug 22 '14 at 13:53xauth add ${DESKTOP}/unix:0
didn't work for you seems to be that ${DESKTOP} expanded to an empty string (i.e., this variable was not set). Otherwise, the situation is similar to https://unix.stackexchange.com/q/234494/4319 and https://stackoverflow.com/questions/20611783/after-changing-hostname-gedit-and-other-x-clients-dont-open ; giving the new hostname forxauth
should help (or setting it to FamilyWild). – imz -- Ivan Zakharyaschev Aug 05 '17 at 15:34