How to install centos in virtualbox to access services in virtual machines

Source: Internet
Author: User

This is the case. I learned how to install a virtual system in virtualbox in cenots. After each installation, you will find that you cannot access frequently used ports such as 80, 21, and 3306. That is to say, I can only access these ports on the local machine and want to access the ports from other machines is not OK. It took me a whole week to know that it was a port problem. You must record it today so that you do not forget it again next time.

Enable ports 80, 21, and 3306:

/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT/sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT/etc/init.d/iptables save service iptables restart

Actually, I read an article I wrote earlier. This article is redundant. Alas. Now that it is written. Write it completely.

In general, we will not use the built-in firewall of Linux. In IDCs, firewalls are hardware. It must be much more powerful than software.

You can use the following methods to operate the Firewall:

Permanently disable the firewall shell:

chkconfig --level 35 iptables off

Run the following command to check whether the firewall is disabled:

service iptables status

If it is disabled correctly, the following information is output:

Iptables: no firewall is running.

If you are an English version, the information may be different.

If no firewall-like information is output, restart the system or run the following command to try it:

service iptables stop

After the firewall is turned off, all enabled ports will be exposed to Internet users. Then, someone with ulterior motives may make some damage to your system vulnerabilities.

In addition to this, there is another things like SELinux. If the firewall has opened the port, it cannot be accessed. It indicates that this item has been restricted. You can just close it.

Related Article

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.