CentOS6.5 environment initialization, centos6.5 Initialization

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.