LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-25-2015, 02:33 PM   #1
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Rep: Reputation: 30
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?
 
Old 05-25-2015, 04:49 PM   #2
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
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.
 
Old 05-25-2015, 10:10 PM   #3
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
nmap, telnet to the port in question, are a couple more tools you can use.
 
1 members found this post helpful.
Old 05-26-2015, 07:48 AM   #4
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Original Poster
Rep: Reputation: 30
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?
 
Old 06-04-2015, 05:00 PM   #5
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
Quote:
Originally Posted by ZAMO View Post
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.
 
Old 06-04-2015, 05:33 PM   #6
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
You probably have bash. http://thesmithfam.org/blog/2006/05/...with-devtcp-2/
 
Old 06-25-2015, 03:44 PM   #7
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Original Poster
Rep: Reputation: 30
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.
 
Old 06-25-2015, 04:31 PM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by ZAMO View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl - Check incoming ports from inside saeen Linux - Newbie 1 02-25-2012 11:27 AM
Outgoing Connectivity problems. Incoming connectivity fine Fionnbharr Linux - Newbie 1 10-02-2008 12:51 PM
check incoming or outgoing packets ilnli Programming 1 07-24-2007 03:08 PM
Check network connectivity ggeorgak Programming 5 08-29-2006 06:20 PM
Connectivity check, quickly, in a script jlangelier Linux - Newbie 6 12-19-2004 10:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration