How to allow remote access to open ports in Linux

How to allow remote access to open ports in Linux

1. Modify the firewall configuration file

# vi /etc/sysconfig/iptables 

wqSave and exit, restart the firewall

service iptables restart

This way port 6379 can be accessed remotely

2. Linux command to open port

Add an open port such as port 80

 # sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT

Save settings

/etc/rc.d/init.d/iptables save

Restart the service to take effect

/etc/init.d/iptables restart

Check whether the open port is effective

/sbin/iptables -L -n

Output the following: Port 80 is open

ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80

The above article on how to allow remote access to open ports in Linux is all I have to share with you. I hope it can give you a reference, and I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • Three ways to check whether a port is open in a remote Linux system
  • Summary of methods to check whether the port is open in Linux
  • Summary of Linux methods for detecting whether a remote port is open
  • Detailed explanation of Linux to view the open port number of the server

<<:  MySQL 8.0.2 offline installation and configuration method graphic tutorial

>>:  Detailed explanation of Vue component reuse and expansion

Recommend

15-minute parallel artifact GNU Parallel Getting Started Guide

GNU Parallel is a shell tool for executing comput...

Detailed explanation of nginx forward proxy and reverse proxy

Table of contents Forward Proxy nginx reverse pro...

Vue template compilation details

Table of contents 1. parse 1.1 Rules for intercep...

vue+tp5 realizes simple login function

This article example shares the specific code of ...

js to achieve simple magnifying glass effects

This article example shares the specific code of ...

Using front-end HTML+CSS+JS to develop a simple TODOLIST function (notepad)

Table of contents 1. Brief Introduction 2. Run sc...

Detailed explanation of JavaScript function this pointing problem

Table of contents 1. The direction of this in the...

A record of the pitfalls of the WeChat applet component life cycle

The component lifecycle is usually where our busi...

How to install ZSH terminal in CentOS 7.x

1. Install basic components First, execute the yu...

HTML reuse techniques

HTML reuse is a term that is rarely mentioned. Tod...

Tutorial on building a zookeeper server on Windows

Installation & Configuration The official web...

Tutorial on logging into MySQL after installing Mysql 5.7.17

The installation of mysql-5.7.17 is introduced be...

How to view the docker run startup parameter command (recommended)

Use runlike to view the docker run startup parame...

JavaScript Canvas implements Tic-Tac-Toe game

This article shares the specific code of JavaScri...