Hi - I opened a port for ftp but on further thought I want to undo what I did close it. I tried
firewall-cmd --zone=public --remove-port=21/tcp --permanent
firewall-cmd --runtime-to-permanent
firewall-cmd --reload
For the first command, I also tried
firewall-cmd --zone=public --service=ftp --remove-port=21/tcp --permanent
But I stll get...
# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: enp1s0
sources:
services: ssh dhcpv6-client ftp
ports: 21/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
What am I doing wrong?
Thanks /j
firewalld won't close a port? [SOLVED}
firewalld won't close a port? [SOLVED}
Last edited by jeffw_00 on 2017/12/17 20:04:08, edited 1 time in total.
Re: firewalld won't close a port?
First, the correct sequence is
firewall-cmd --zone=public --remove-port=21/tcp --permanent
firewall-cmd --reload
(otherwise 2nd command wipes effect of first)
Second - answer is to keep it simple
firewall-cmd --remove-port=21/tcp --permanent
firewall-cmd --reload
ftp is a built-in service so can't remove it.
/j
firewall-cmd --zone=public --remove-port=21/tcp --permanent
firewall-cmd --reload
(otherwise 2nd command wipes effect of first)
Second - answer is to keep it simple
firewall-cmd --remove-port=21/tcp --permanent
firewall-cmd --reload
ftp is a built-in service so can't remove it.
/j