I want to open port 443 in my Debian 8 server but i get permission denied error.
my rules.v4 file looks like:
# Generated by iptables-save v1.4.21 on Wed Feb 15 14:42:03 2017 *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [208710:151335680] -A INPUT -p icmp -m comment --comment "000 accept all icmp" -j ACCEPT -A INPUT -i lo -m comment --comment "001 accept all to lo interface" -j ACCEPT -A INPUT -m comment --comment "002 accept related established rules" -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m multiport --dports 22 -m comment --comment "099 allow ssh access" -j ACCEPT -A INPUT -p tcp -m multiport --dports 80,443 -m comment --comment "100 allow http and https access" -j ACCEPT -A INPUT -p tcp -m multiport --dports 1122 -m comment --comment "150 allow phpmyadmin access" -j ACCEPT -A INPUT -m comment --comment "999 drop all" -j DROP COMMIT # Completed on Wed Feb 15 14:42:03 2017 After making the changes in /etc/iptables/rules.v4 i tried to save with
sudo iptables-save > /etc/iptables/rules.v4 I get error message -bash: /etc/iptables/rules.v4: Permission denied
I tried with sudo bash -C "iptables-save > /etc/iptables/rules.v4" i get no such file or directory when the file exists.
I also tried with tee
sudo tee iptables-save > /etc/iptables/rules.v4 and
sudo sh -c "iptables-save > /etc/iptables/rules.v4" when i do netstat -tulnp | grep 443 i get no output.
/etc/iptables/directory. Check that first and move further./etc/iptablesdoes exist... i haverules.v4andrules.v6files inside