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

cups stands for..?

6 Answers   IBM,


How can i recover the linux system after it was crashed by step by step process..

3 Answers   IBM,


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

9 Answers  


How to ""Add"" not replace address to same network card other than the alias way.... ??????

3 Answers  


what is meant by mysql clustering

2 Answers  






How to give 2 different gateway IP addresses for 2 different interfaces in same system ?

5 Answers   Toyota,


am installed windows and later i installed ubuntu i want to unistall ubuntu can any one tel the procedure to uninstall ubuntu in my windows 7 please mail to me ---kiranpulsar2007@gmail.com and later i want to install ubuntu after uninstalling ubuntu tel the procedure for that also i dont know to patrition the hard disk drive please tel to them please reply

1 Answers  


Without using w command how can Iknow that who are users logged in and what they are doing and whether they are idle or running mode?

4 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,


User unable to login in server then how can u troubleshooting it? Example: server at Bangalore. in that server two users try to login in server. 1st user able to login. but second user unable to login so how can troubleshoot it ?

5 Answers   Oracle,


What are the main differences between RHEL4 & RHEL5?

11 Answers  


what are acl permissions..? what is automation of jobs..?

5 Answers   IBM, TCS,


Categories