How to check all open ports on linux machine and block
unsed ports????????




Answers were Sorted based on User's Feedback



How to check all open ports on linux machine and block unsed ports????????..

Answer / sureshreddy

#netstat -tulp
or
#netstat -tulpn

to verfy the open ports

Is This Answer Correct ?    17 Yes 1 No

How to check all open ports on linux machine and block unsed ports????????..

Answer / raghu

netstat -t

Is This Answer Correct ?    19 Yes 11 No

How to check all open ports on linux machine and block unsed ports????????..

Answer / parthasarathy k

#nmap -v localhost for tcp
#nmap -sU localhost for udp

Is This Answer Correct ?    12 Yes 6 No




How to check all open ports on linux machine and block unsed ports????????..

Answer / manoj

netstat -t(tcp)
netstat -u(udp)or
netstat -tulpn
to verfy the open ports
to block u have to use iptable & tcp_wrappers( hosts.deny
file)

Is This Answer Correct ?    6 Yes 1 No

How to check all open ports on linux machine and block unsed ports????????..

Answer / pankaj pal

To check all the Open Ports use command
netstat - tulpn

To Block Ports for eg.22 and 80 as requested by Ashish
iptables -t filter -A INPUT -s!192.168.0.0/24(IP which you
want to allow) -p tcp -d (destination server IP) --dport
22 -j DROP

iptables -t filter -A INPUT -s!192.168.0.0/24(IP which you
want to allow) -p tcp -d (destination server IP) --dport
80 -j DROP

Is This Answer Correct ?    5 Yes 0 No

How to check all open ports on linux machine and block unsed ports????????..

Answer / boby

netstat -at | grep LISTEN

Is This Answer Correct ?    3 Yes 0 No

How to check all open ports on linux machine and block unsed ports????????..

Answer / ashish

Hi!! All
Can you give an example to block certain ports
like block 22 & 80.

Any help will be appreciated.

Ashish

Is This Answer Correct ?    2 Yes 1 No

Post New Answer



More Linux AllOther Interview Questions

What are main anti-spam features available in sendmail?

1 Answers   CSC,


someone already asked 'what is diff between unix & Linux' can I ask the same but more nuanced...I have 7 years app support of unix, have never seen Linux BUT need to bluff my way through in an interview i e say that I have use Linux. What are the most important things I need to know?

1 Answers  


Which directory is closer to the top of the file system tree, parent directory or current directory?

3 Answers  


why you are using nis server

2 Answers  


In how many ways linux can be installed n explain th steps involved in installation in any of the method..?

1 Answers   IBM,






will u plz send me the complete steps of installation of red hat linux on intel's core 2 duo processor?

1 Answers  


how can i make an user to nologin without locking the account for the user

7 Answers   CSS, CSS Corp,


What is the difference between an argument and an option/switch?

3 Answers   Wipro,


what is difference between  TFTP abd FTP?

0 Answers  


What are RPM?s, what do they offer?

2 Answers  


what restrict telnet for root itself but allow for other user

3 Answers   CA,


In Linux(RHEL) server have two users with same name. one is local user and second one is NIS user. if you login the server which user will login (local or NIS)

1 Answers  






Categories