Often need to replicate VMs in VMware, for the new machine to be copied to modify the machine name, or in the same LAN conflict, the following is the Linux system to view and modify the machine name method and steps:
1. Check the machine name of the system:
Log in with the root user and enter in the terminal console: hostname
[Email protected]]# hostname
Aaaaaname
2, temporarily modify the machine name:
[Email protected]]# hostname yourname
[Email protected]]# hostname
Yourname
Note: However, the 2nd step of the modification can only be temporary effective, the machine restarted and restored, want to make the modification permanent effect, but also continue the following steps:
3. Modify the Hosts file (path:/etc/hosts):
[Email protected]]# vi/etc/hosts
Change all the original names in the hosts to the name you want to change.
4. Modify the Network file (path:/etc/sysconfig/network):
[Email protected]]# vi/etc/sysconfig/network
Change the hostname=xxx in XXX to the name you want to change.
5. Restart the machine:
[email protected]]# reboot
OK, the modification is complete ~~~~~~~~
This article is from the "Qytag (upspringing)" blog, so be sure to keep this source http://qytag.blog.51cto.com/6125308/1579146
Linux view and modify machine names