SteamOS: Change Hostname

This is part of a series of posts where I put down what I did while playing around with SteamOS.

I wanted to change the hostname of the system, because my router resolves the hostnames quite nicely. This machine was supposed to be called „art„. That is quite simple to achieve by editing to files:

  • Change to a local terminal via Ctrl+Alt+F1 (get back to the UI via Ctrl+Alt+F7.) SSH isn’t that useful because we will be restarting the network at the end, disconnecting the SSH session.
  • Chose an editor. I’m using vi, which is a bit odd to some, maybe use nano if you are unsure.
  • Login as user desktop. If you didn’t need to enter a password, set one by executing „passwd“ (it’ll ask you for your new password twice), because sudo won’t work otherwise.
  • Open the file /etc/hostname by entering „sudo nano /etc/hostname“ and change the hostname there
  • Also run „sudo nano /etc/hosts“ and change the two occurences of the old hostname there as well
  • At last restart the network services by running „sudo /etc/init.d/networking restart“
  • If you logout of the current terminal (exit) and login again, the hostname should be changed.