Quote:
Originally Posted by linux_alain
My question is i wanna know what command i can use that list rule 2 and 3 for instance in my table?
|
For example you can use "sed" command:
Code:
iptables -t filter -S | sed -n '5,6p'
There is 3 lines offset because first 3 listed rules are policies. You can check manually how many lines to skip or write more advanced sed expression.
Quote:
I created my own chain (iptables -N MY_CHAIN)
then i used the command
#iptables -A INPUT -p icmp -j MY_CHAIN
[...]
then when i tried to delete the new chain i couldnt using this command
#iptables -X MY_CHAIN
i read through the internet and i guess the reason is that this created chain has referenced as a target by the input chain so that i cant delete it
my question is : what if i need to force the deleting?
|
Obviously - delete or change rules which have this chain as their target. How firewall would be known what to do with packet, if it will has inexistent target?
Quote:
i want to create rule that: The host is administered using SSH, scp and sftp so allow incoming SSH traffic and securing remote file copying and transferring
what is best input output chain rules i can use?
|
It depends on needs. For example, if you only access this server from known IPs/MACs you can restrict access to it. Or you are not bother about using port knock (nice security tool). There are tool for automatically add DROP for certain IPs rules when they discover port scanning or few failed ssh logins.