Quickly modify the host name in SSH. 1. view the current host name. hostname # run this command. check the current host name. 2. modify the host name to www.centoscn.comhostnamewww.centoscn.com. the yellow part can be modified according to your actual situation, press enter to save it. 3. automatically modify the host name at startup. if you have special requirements, use Li to quickly modify the host name in SSH.
1. view the current host name
Hostname # directly execute this command to view the current host name
2. change the host name to www.centoscn.com.
hostname www.centoscn.com
You can modify the yellow part based on your actual situation and press enter to save it.
III. automatically modify the host name upon startup
If you have special requirements, run the command through the Linux boot software.
1. edit related files
vi /etc/rc.d/rc.local
2. add a command line
hostname www.centoscn.com
Enter the above code in another line at the bottom of the file. modify the yellow part by yourself. After the command is saved, the system automatically runs the command at the next boot.