In CentOS 7
Temporarily open FTP service
# is firewall – CMD – add – service = FTP
Open the FTP service permanently
# is firewall – CMD – add – service = FTP – permanent
Permanent ban
# is firewall – CMD – remove – service = FTP – permanent
success
Enabling Settings
# systemctl restart firewalld
Check if the Settings are in effect
# iptables – L – n | grep 21
ACCEPT the TCP – 0.0.0.0/0 0.0.0.0/0 TCP DPT: 21 ctstate NEW
Check firewall status
# is firewall – CMD – state
running
# systemctl stop firewalld
# is firewall – CMD – state
not running
# is firewall – CMD – list – all
Public (default) interfaces: sources: services: dhcpv6-client FTP SSH ports: masquerade: no forward-ports: ICMP-blocks: rich rules:
The name of the service in FirewallD
# firewall-cmd –get-service amanda-client bacula DHCP dhcpv6 dhcpv6-client DNS FTP high-availability HTTP HTTPS iMAP ipp ipp ip-client ipsec kerberos kpasswd ldap ldaps libvirt libvirt-tls mdns mountd ms-wbt mysql nfs ntp openvpn pmcd pmproxy pmwebapi pmwebapis pop3s postgresql proxy-dhcp radius rpc-bind samba samba-client smtp ssh telnet tftp tftp-client transmission-client vnc-server wbem-https
Query the enabling status of the service
# firewall-cmd –query-service FTP yes # firewall-cmd –query-service SSH yes # firewall-cmd –query-service samba no # firewall-cmd –query-service HTTP no
Join the Port you want to open
# firewall-cmd –add-port=3128/ TCP # firewall-cmd –list-all public (default) interfaces: sources: services: dhcpv6-client FTP SSH ports: 3128/ TCP masquerade: no forward-ports: firewall-cmd –add-port=3128/ TCP # firewall-cmd –list-all public (default) interfaces: sources: services: dhcpv6-client FTP SSH ports: 3128/ TCP masquerade: no forward-ports: The icmp – blocks: rich rules:
Read More:
- Centos7 view and close firewall
- Linux turn off enable firewall command
- Kill the specified port CMD command line taskkill in window
- Computer CMD window net view command 6118 error resolution
- Use sc command under CMD, report openservice failed 1060 error
- Python – [encoding] in Python os.system Solution to Chinese garbled code when calling CMD command
- Vue cli 4 CMD command creates an error: error command failed NPM install – loglevel error – solution
- When installing mysql, an error occurs when executing the installation command with the CMD window. Install / Remove of the Service denied
- Error: command error out with exit status 1: Python when installing mysqlclient in centos7 setup.py egg_ info Check
- The solution of centos7 in VMware virtual machine unable to access after installing nginx
- [error handling] when logging into MySQL with CentOS command, an error 1045 (28000) is reported
- How to Perfectly Uninstall ZoneAlarm Free Firewall
- Solution to redis error in CentOS of idea connected virtual machine
- CentOS execution command error: – bash: fork: cannot allocate memory processing / viewing process number
- When centos7 uses the man search command, an error is reported no manual entry for XXXX
- The solution of centos7’s inaccessibility after installing nginx
- The problem of “value error: zero length field name in format” in Python 2.6.6 of CentOS 6.9
- Solution to the problem that listen TCP 0.0.0.0:3306: bind: address already in use port is occupied in Linux centos7
- CentOS 8.1 solution to error in executing #systemctl restart network.service
- Centos7 viewing and closing firewalls