Configure network firewalls and user groups in CentOS-6.4-minimal

Source: Internet
Author: User

Configure network firewalls and user groups in CentOS-6.4-minimal

Configure network _ firewall _ User Group _ JDK in CentOS-6.4-minimal
Bytes ------------------------------------------------------------------------------------------------------------------
[Installation]
Virtual Machine download: https://www.virtualbox.org/wiki/Downloads
Image address: http://mirrors.163.com/centos/6.4/isos/x86_64/ (I use a CentOS-6.4-x86_64-minimal.iso here)
There is nothing to pay attention to during the installation process. By default, you only need to pay attention to Asia/ShangHai when selecting the time zone.
After the installation is complete, the system automatically enters the multi-user status and has the network service running level. That is, the default value in the/etc/inittab file is id: 3: initdefault:
Do not try to change to 5, because the minimal version does not have a graphical user interface program installed by default.
I changed 3 to 5 out of curiosity. Then I restarted CentOS and found that it would remain stuck at the position of 100% on the startup progress bar. Then I changed it back to 3 through the following method.
(Unlike this article, if you press 2, enter [1], that is, a space and 1)
Bytes ------------------------------------------------------------------------------------------------------------------
Nic]
By default, the eth0 Nic is not enabled for CentOS. What we do is to enable it.
[Root @ CentOS64 ~] # Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Modify ONBOOT = yes (now VirtualBox is configured as a bridge Nic to enable CentOS networking in the virtual machine)
Bytes ------------------------------------------------------------------------------------------------------------------
[IPv6]
To check whether the current IP address contains an IPv6 address, run the ifconfig command. If inet6 addr: fe80: 20c: 29ff: fee4: 1d8/64 is found, IPv6 is included.
IPv6 is not available yet, while CentOS enables IPv6 by default, so we need to disable it.
[Root @ CentOS64 ~] # Vi/etc/modprobe. d/dist. conf
Add the following two lines to the end of the dist. conf file (to enable IPv6 support again, comment on the two lines)
Alias net-pf-10 off
Alias ipv6 off
Bytes ------------------------------------------------------------------------------------------------------------------
Firewall]
1) Disable firewall ----- service iptables stop
2) start firewall ----- service iptables start
3) restart the firewall ----- service iptables restart
4) view the Firewall status-service iptables status
5) permanently disable the firewall -- chkconfig iptables OFF
6) Enable -- chkconfig iptables ON after permanent shutdown
After installing and configuring the above steps, I started a small application written with Mina and found that the application in the virtual machine could not be accessed in the notebook, however, it is painful to ping the IP address in the VM.
Therefore, if you run the [service iptables status] command and find that port 22 is enabled for CentOS by default (so you can use tools such as xshell to connect to CentOS through SSH), you need to activate the port.
[Root @ CentOS64 ~] # Vi/etc/sysconfig/iptables
We will find that there is A row written in this way-a input-p tcp-m state -- state NEW-m tcp -- dport 22-j ACCEPT
Then write-a input-p tcp-m state -- state NEW-m tcp -- dport 8080-j ACCEPT under this line according to the Huludao.
Finally, run the [service iptables restart] command. port 8080 of the server can provide external services.
Bytes ------------------------------------------------------------------------------------------------------------------
[Users and groups]
1) [root @ CentOS64 ~] # Groupadd Develop (add a Develop group)
2) [root @ CentOS64 ~] # Useradd-g Develop bkjia (create a Jadyer user and assign it to the Develop group)
3) [root @ CentOS64 ~] # Passwd bkjia (set or modify the bkjia user password)
4) [root @ CentOS64 ~] # Chown-R bkjia. Develop/app (change the owner of the/app directory to bkjia user and Develop group)
Bytes ------------------------------------------------------------------------------------------------------------------
[JDK]
1) copy the downloaded jdk-6u45-linux-x64.bin to the/app/java/directory
2) run the installation Command [bkjia @ CentOS64 ~] $./Jdk-6u45-linux-x64.bin
3) configure the environment variable [root @ CentOS64 ~] # Vi/etc/profile
# Set Java Environment Variable
JAVA_HOME =/app/java/jdk1.6.0 _ 45
PATH = $ PATH: $ JAVA_HOME/bin
Export JAVA_HOME PATH
4) Verify [bkjia @ CentOS64 ~] $ Java-version
Bytes ------------------------------------------------------------------------------------------------------------------

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.