LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Need a command to check incoming connectivity (https://www.linuxquestions.org/questions/linux-security-4/need-a-command-to-check-incoming-connectivity-4175543562/)

ZAMO 05-25-2015 02:33 PM

Need a command to check incoming connectivity
 
Hi ,

Am looking for a command to check the incoming connectivity on the port 22 and 10022 for a server.
Am able to connect from serverA to serverB on these ports, but is there a way to find out that these ports are allowing incoming connections with any commands(from serverB only), except the iptables?

mralk3 05-25-2015 04:49 PM

Need a command to check incoming connectivity
 
What service are you expecting to connect to on each port? You can try connecting with netcat and you can sniff the connection with tcpdump if the two servers are on the same network.

Doug G 05-25-2015 10:10 PM

nmap, telnet to the port in question, are a couple more tools you can use.

ZAMO 05-26-2015 07:48 AM

Thanks for both the replies .

nmap is not allowed , as like tcpdump . Telnet is not available

Am using
Code:

nc -z -v serverB 22
or
Code:

nc -z -v serverA  10022
from

But nc is not available in serverB . Is there any option that this can be done with netstat?

joec@home 06-04-2015 05:00 PM

Quote:

Originally Posted by ZAMO (Post 5367573)
But nc is not available in serverB . Is there any option that this can be done with netstat?

netstat -l

But you can only do this locally, it will not give you information on the remote server.

linosaurusroot 06-04-2015 05:33 PM

You probably have bash. http://thesmithfam.org/blog/2006/05/...with-devtcp-2/

ZAMO 06-25-2015 03:44 PM

This is a very useful link . But the details in it is not helping me for my requirement .
I can re-describe the requirement here now.

port 22 and 10022 are opened in serverB , so that a user from serverA can reach serverB on these ports . It is a Oneway connection , Reverse connections are not allowed.

Since am sitting in server B , I just want to check the incoming connections are allowed on ServerB from the serverA on the ports 22 and 10022.

Habitual 06-25-2015 04:31 PM

Quote:

Originally Posted by ZAMO (Post 5383015)
This is a very useful link . But the details in it is not helping me for my requirement .
I can re-describe the requirement here now.

port 22 and 10022 are opened in serverB , so that a user from serverA can reach serverB on these ports . It is a Oneway connection , Reverse connections are not allowed.

Since am sitting in server B , I just want to check the incoming connections are allowed on ServerB from the serverA on the ports 22 and 10022.

You can check if ServerB ports are open using
Code:

telnet localhost <port>
But you'd be hard pressed to check if ServerA can connect to ServerB's open ports from ServerB.


All times are GMT -5. The time now is 12:13 AM.