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?

  • How did you manage to change the host's name? I use F19 and F20 and have set my hostname and do not suffer from this particular issue. I've generally used these methods in the past to set my system's (Fedora) hostname: lamolabs.org/blog/6364/… – slm Aug 22 '14 at 13:17
  • I used hostname DESKTOP. I can't access your link, there is an error, could you check it ? – Anonymous12223 Aug 22 '14 at 13:51
  • Try adding [your hostname] to /etc/hosts. – Renan Aug 22 '14 at 13:53
  • Yeah it's my blog, it's not accessible to some parts of the world. – slm Aug 22 '14 at 14:01
  • @xhaltar - here this shows essentially the same methods: labtestproject.com/using_linux/… – slm Aug 22 '14 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.