how u use the iptable firewall to restrict ssh,telnet,ftp

Answers were Sorted based on User's Feedback



how u use the iptable firewall to restrict ssh,telnet,ftp..

Answer / sins

simply use..... iptables -A INPUT -s <sourse ip or n/w u
want to block the services> -p tcp --dport <specify prt
number> -j REJECT/DROP/DENY

Is This Answer Correct ?    26 Yes 0 No

how u use the iptable firewall to restrict ssh,telnet,ftp..

Answer / rajesh dwivedi

If you restrict ssh/telnet or ftp u have to write a rule
for example u have to restrict ssh

IPTABLES -A INPUT -p tcp -s <IP Address or Domain IP> --
dport <ssh port> -j REJECT/DROP

Is This Answer Correct ?    12 Yes 0 No

how u use the iptable firewall to restrict ssh,telnet,ftp..

Answer / saurabh makkar

For SSH
iptables -A INPUT -s <sourse ip or n/w u
want to block the services> -p tcp --dport <22> -j
REJECT/DROP/DENY

For Telnet
iptables -A INPUT -s <sourse ip or n/w u
want to block the services> -p tcp --dport <23> -j
REJECT/DROP/DENY

For FTP
iptables -A INPUT -s <sourse ip or n/w u
want to block the services> -p tcp --dport <21> -j
REJECT/DROP/DENY

Is This Answer Correct ?    6 Yes 0 No

how u use the iptable firewall to restrict ssh,telnet,ftp..

Answer / srivathsan

Just a small typo to the file name, it is '/etc/hosts.deny'

Thanks,

- Vathsan.

Is This Answer Correct ?    5 Yes 2 No

how u use the iptable firewall to restrict ssh,telnet,ftp..

Answer / swapnil

if want to put on the INPUT then
iptables -A INPUT -s source -p protocol --dport destination
port -j DENY
if want to put the OUTPUT tables then
iptables -A OUTPUT -s source -p protocol --dport denation
port -j DENY

Is This Answer Correct ?    2 Yes 0 No

how u use the iptable firewall to restrict ssh,telnet,ftp..

Answer / srivathsan

Followed by iptables command mentioned by Sins to restrict
domains for various services, pleaese run
$ service iptables save
$ restorecon /etc/sysconfig/iptables.

Also, you could block the domains by adding an entry inside
/etc/hots.deny like,

sshd: <Unwanted domain url>

:qw to save changes to the file.

- Vathsan.

Is This Answer Correct ?    4 Yes 3 No

how u use the iptable firewall to restrict ssh,telnet,ftp..

Answer / nrupan mampilly

iptables -I INPUT -t filter -s source -p protocol --dport
portnumber -j REJECT

Is This Answer Correct ?    0 Yes 0 No

how u use the iptable firewall to restrict ssh,telnet,ftp..

Answer / sanjay

service iptables start
iptables on

Is This Answer Correct ?    10 Yes 12 No

how u use the iptable firewall to restrict ssh,telnet,ftp..

Answer / anil kumar pinnaka

chkconfig --level < run level for enabling the iptables > on

This will enables the ip table for the given run level.

so that these service will ge blocked.

Is This Answer Correct ?    1 Yes 15 No

Post New Answer

More Linux AllOther Interview Questions

What is the use of DNS Server? Name other servers works same as like DNS?

2 Answers  


Tell me command which is use for create quota database in Linux.

7 Answers   Wipro,


Friends, I don't have enough free space in root directory. but in home directory I have 40gb free. So I can not install anything in root directory (which occupies more space) Please suggest me If there is any possibility to increase the root directory size by minimising the home directory's.

3 Answers  


I have accidently deleted my fstab... how do i recover/ regenerate the file?????? in rescue mode i cannot create a new file since the filesystem is readonly and could not mount in readwrite mode ?????????

6 Answers   IBM,


Hi all Could u plz tell me how I can get UNIX/Linux Certification

2 Answers   Accenture,






Give a Linux shell command to find all files in a directory which contain ip addresses.

1 Answers   Amazon,


What is the other method of installing Linux O.S other than Text, GUI mode? Why we prefer that for installation of Linux in Real time?

2 Answers  


what is the difference between NIS and DNS...?

5 Answers   IBM,


what is meant by mysql clustering

2 Answers  


This question is belong to linux support. "one of my customer told to me, my application is getting slow response". how to resolve the issue. what are the steps you will follow to resolve the issue.

0 Answers  


what is the use of runlevel 4 in redhat linux? in which cases it will use.

1 Answers  


What is the name and path of the main system log?

3 Answers  


Categories