Pages

Tuesday, November 26, 2013

How to change your hostname with SSH

If you’ve worked in the admin world for any length of time, you’ve probably run into an instance where you needed to change the hostnames on your server to match some corporate naming standard, but you can’t have downtime either.

Changing the Hostname


First, you must change the config file that controls this. The actual file and its location will vary across distributions. In the Redhat derivatives, the file to modify is /etc/sysconfig/network so vi this file and change the line that reads HOSTNAME=

Log into PuTTY using your username (usually root) and password

  1. Type "cd /etc/sysconfig/" to take you to the sysconfig folder
  2. Type "vi network" to open your network settings
  3. Type "i" on your keyboard and update your HOSTNAME
  4. Press "ESC" on the keyboard
  5. Save the new configuration by typing ":wq!"
  6. Finally, log off and reboot

No comments:

Post a Comment