Linux Kernel EMD -- start/stop/restart the service in RHEL/CentOS 7
One of the major changes in RHEL/CentOS 7.0 is switching to systemd. It is used to replace SysV and Upstart in the previous versions of Red Hat Enterprise Edition Linux to manage systems and services. Systemd is compatible with the startup scripts of S
One of the major changes in Rhel/centos 7.0 is the switch to systemd. It is used to replace SYSV and upstart in previous versions of Red Hat Enterprise Linux and to manage systems and services. SYSTEMD is compatible with startup scripts for SYSV and Linux standard groups.Systemd is a system and service Manager under a Linux operating system. It is designed to be backwards compatible with SYSV startup scripts and provides a number of features, such as
The CentOS 7 default utility uses FIREWALLD as the firewall, discarding the original iptables. But the kernel still uses iptable as the managementReference documentsHttps://access.redhat.com/documentation/zh-CN/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.htmlHttp://www.myhome.net.tw/2015_02/p10.h
For the pure version of CentOS 7, you must install the firewall manually. But if you install a firewall or you can't run it right away, you need to do something else to make it work. Follow these steps to set up your firewall in CentOS
The newly installed CentOS 7 found that some of the program ports were off, thinking of firewalls and SELinuxSelinx Good close/etc/sysconfig/selinux append selinux=disabledFirewall thought is also very good to get, according to the old ritual, service iptables stop or chkconfig--level iptables offRun Systemctl list-unit-files after reboot | grep IP found another
Use Firewall in CentOS 7
In CentOS 7, a new service is introduced,Firewalld, the following figure shows the relationship and difference between Firewall and iptables.
To install it, you only need
#yuminstallfirewalld
If you need a
One of the major changes in Rhel/centos 7.0 is the switch to SYSTEMD. It is used to replace SYSV and upstart in previous versions of Red Hat Enterprise Linux and to manage systems and services. SYSTEMD is compatible with startup scripts for SYSV and Linux standard groups.SYSTEMD is a system and service Manager under a Linux operating system. It is designed to be backwards compatible with SYSV startup scripts and provides a number of features, such as
One of the major changes in Rhel/centos 7.0 is the switch to systemd. It is used to replace SYSV and upstart in previous versions of Red Hat Enterprise Linux and to manage systems and services. SYSTEMD is compatible with startup scripts for SYSV and Linux standard groups.Systemd is a system and service Manager under a Linux operating system. It is designed to be backwards compatible with SYSV startup scripts and provides a number of features, such as
Set iptables firewall whitelist in Linux (RHEL 6 and CentOS 7)
Go to the Linux Command Line and edit the firewall rule configuration file iptables.Vi/etc/sysconfig/iptables
The following is an example of whitelist settings:
# Firewall configuration written by system-config-s
Turn on the Redis port and modify the firewall configuration file Vi/etc/sysconfig/iptablesJoin Port Configuration-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 6379-j ACCEPT-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 6379:7000-j ACCEPT//Open ports between 6379 and 7000Service Iptables SaveService Iptables RestartCentOS 7.0 defaults
Turn on the Redis port and modify the firewall configuration file Vi/etc/sysconfig/iptablesJoin Port Configuration-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 6379-j ACCEPT-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 6379:7000-j ACCEPT//Open ports between 6379 and 7000Service Iptables SaveService Iptables RestartCentOS 7.0 defaults
How to stop and unseal IP addresses in centos 7
I. Stopping an ip address
I haven't logged on to my VPS for a long time. I logged in with Xshell today and saw the Last Failed Login. I carefully checked that some unknown ip addresses tried to crack my VPS, after confirming with the partner that it is not his ip address, he decided to block the ip address.
(Fi
Turn on the Redis port and modify the firewall configuration file Vi/etc/sysconfig/iptablesJoin Port Configuration-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 6379-j ACCEPT-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 6379:7000-j ACCEPT//Open ports between 6379 and 7000Service Iptables SaveService Iptables RestartCentOS 7.0 defaults
rh-firewall-1-input-m State--state new-m tcp-p TCP--dport 22-j accept-a rh-firewall-1-input-m State--stat E new-m tcp-p tcp--dport 4750-j accept-a rh-firewall-1-input-m State--state new-m tcp-p TCP--dport 3306-j List-a rh-firewall-1-input-j REJECT--reject-with icmp-host-prohibited COMMIT
The part of the white list
Set a firewall whitelist in Linux (RHEL 6 and CentOS 7)
Go to the Linux Command Line and edit the firewall rule configuration file iptables.Vi/etc/sysconfig/iptables
The following is an example of whitelist settings:
# Firewall configuration written by system-config-security
Turn on port 801.Firewall-cmd --zone=public --add-port=/tcp --permanent Success appears to indicate added successCommand meaning:--zone #作用域--add-port=80/tcp #添加端口 in the format: Port/Communication protocol--permanent #永久生效, fail after reboot without this parameterRestarting the firewall1.systemctl Restart Firewalld.service1. Run, stop, disable FIREWALLDStart: # systemctl start FirewalldView Status: # Sys
First, configure the firewall, open 80 ports, 3306 ports
CentOS 7.0 uses firewall as a firewall by default, and this is iptables firewall instead.
1. Close firewall:
Systemctl Stop Fir
One, port configuration
Open the Redis port and modify the firewall configuration file Vi/etc/sysconfig/iptables
Join Port Configuration
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 6379-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 6379:7000-j ACCEPT
Open ports between 6379 and 7000
Service Iptables Save
Service Ipt
1. Turn on the firewallSystemctl Start Firewalld2. AddFirewall-cmd--zone=public--add-port=80/tcp--permanent3. Re-loadingFirewall-cmd --zone= public --query-port=80/tcp 4. DeleteFirewall-cmd--zone= public --remove-port=80/tcp--permanent Command meaning:--zone #作用域--add-port=80/tcp #添加端口 in the format: Port/Communication protocol--permanent #永久生效, fail after reboot without this parameter3.firewall-cmd--reloadAttach the basic use of the firewall1, th
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.