I need to change the hostname of a system without rebooting it. Im running CentOS 7 and have the correct hostname in the /etc/hostname file but im still showing the old hostname at prompt. I know that when I reboot the system it will check the hostname file and apply it, but is there anyway for me to update that without rebooting? Here is some info from the command line:
[root@gandalf sysconfig]# cat network NETWORKING=yes GATEWAY=192.168.80.1 HOSTNAME="sauron.domain.com" [root@gandalf sysconfig]# cd .. [root@gandalf etc]# cat hostname sauron [root@gandalf etc]#
Im unable to reboot this server anytime soon and some of my team is mixing up the server due to the hostname showing an older system name. Simply put: need prompt to show
[user@sauron dir]# instead of
Google'd around for this but wasn't able to see a way to do this without the reboot. Thanks for your consideration!