How to change hostname via SSH for Linux Centos? We recommend you use below command to change hostname via ssh
What's you need to do is: Copy and post below single command line via SSH root login. change the YOUR-NEW-HOSTNAME to whatever you want for your hostname. then run the command(press Enter), Done!
cd /tmp; wget http://www.comfortvps.com/script/shell/ssh/sethostname.sh; sh ./sethostname.sh YOUR-NEW-HOSTNAME;