1

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: http://www.lamolabs.org/blog/6364/one-liner-how-to-change-the-hostname-on-a-fedoracentosrhel-system/#more-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 127.0.0.1 [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: http://www.labtestproject.com/using_linux/permanently_change_hostname_on_fedora – slm Aug 22 '14 at 14:15
  • The reason why xauth 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 for xauth should help (or setting it to FamilyWild). – imz -- Ivan Zakharyaschev Aug 05 '17 at 15:34

0 Answers0