CentOS6.5 environment initialization, centos6.5 Initialization
Modify the default Host Name of CentOS6.5 (root operation)
After the official CentOS6.5 image is installed, the default host name is localhost, which is inconvenient to manage and needs to be modified according to the actual situation.
Here I'm going to talk about changing the default host name localhost to comex01-ct65
Step 1: modify the system network configuration file
First, back up the file to be modified:
Cp/etc/sysconfig/network. 'date + % Y % m % d. % H % M % s'
Then begin to modify:
Vi/etc/sysconfig/network
Enter I, enter edit mode, change HOSTNAME to the name comex01-ct65 we want
Finally, wq saves the file
Step 2: Modify hosts
First, back up the file to be modified:
Cp/etc/hosts. 'date + % Y % m % d. % H % M % s'
Then begin to modify:
Vi/etc/hosts
Add the host name to be modified after 127.0.0.1 (note that you need a space ):
Finally, wq saves the file
Step 3: Use hostname to modify the current host name
After the preceding two steps are executed, the restart is required to take effect. However, if you do not want to restart, you can directly execute the following command to force the restart to take effect:
Hostname comex01-ct65
Then exit and log on again:
Exit
Disable CentOS6.5 local firewall (root)
The built-in firewall of CentOS6.5 does not make much sense for us for a lot of time. To close it, we will briefly describe how to close it:
Run the following command to view the Firewall Status:
Service iptables status
The information shown indicates that the current firewall is enabled.
Run the following command to disable the Firewall:
Service iptables stop
Run the following command again to check the Firewall Status:
Service iptables status
System prompt: iptables: Firewall is not running. It indicates that the stop is successful.
Finally, disable the firewall to enable self-startup:
Chkconfig iptables off
Check whether closing is successful:
Chkconfig -- list iptables
If all values are off, auto start is disabled: