LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-20-2008, 03:21 PM   #1
craftereric
LQ Newbie
 
Registered: Mar 2008
Posts: 21

Rep: Reputation: 15
need explanation about nmap and how to open a port


OS: Redhat 3, update 7
Java 1.5.0_05

I have a Java server program that is running and listening on port 3899 of machine B. On machine B, netstat -an|grep 3899

shows
tcp 0 0 127.0.0.1:3899 0.0.0.0:* LISTEN

However, on machine B, nmap -v localhost shows
==============
Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Host localhost.localdomain (127.0.0.1) appears to be up ... good.
Initiating SYN Stealth Scan against localhost.localdomain (127.0.0.1)
Adding open port 8082/tcp
Adding open port 22/tcp
Adding open port 113/tcp
Adding open port 389/tcp
Adding open port 8009/tcp
Adding open port 6000/tcp
Adding open port 80/tcp
Adding open port 111/tcp
Adding open port 631/tcp
The SYN Stealth Scan took 2 seconds to scan 1601 ports.
Interesting ports on localhost.localdomain (127.0.0.1):
(The 1592 ports scanned but not shown below are in state: closed)
Port State Service
22/tcp open ssh
80/tcp open http
111/tcp open sunrpc
113/tcp open auth
389/tcp open ldap
631/tcp open ipp
6000/tcp open X11
8009/tcp open ajp13
8082/tcp open blackice-alerts
==================

My question is:

What do I need to do so that port 3899 will show up in the nmap list above as OPEN.

I tried iptables -I INPUT -p tcp --dport 3899 -j ACCEPT with no success.

I am trying to troubleshoot a Linux problem in which I cannot use a client to run this program remotely from a different server, machine A. The connection is always refused. Note that on two Windows machines, things run successfully.

redhat-configure-securitylevel shows that the firewall is enabled. I tried disabling with no success.

Any suggestions for troubleshooting this are appreciated. I am out of ideas.

Last edited by craftereric; 08-20-2008 at 03:28 PM.
 
Old 08-20-2008, 08:46 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 377Reputation: 377Reputation: 377Reputation: 377
I think port 3899 isn't one of the ports it scans by default.

Try telling nmap that you wish to scan that port specifically:
Code:
nmap -v localhost -p 3899

Last edited by win32sux; 08-20-2008 at 08:47 PM.
 
Old 08-21-2008, 07:39 AM   #3
craftereric
LQ Newbie
 
Registered: Mar 2008
Posts: 21

Original Poster
Rep: Reputation: 15
follow-up question

Thanks for the response. You were correct. Apparrently 3899 is not scanned automatically.

nmap -v localhost -p 3899 shows:
Port State Service
3899/tcp open unknown

which is what I want on machine B.

Follow-up question(s):
I need to be able to remotely execute this process from a different machine A. In the windows, I can test if the remote invocation will work by executing telnet <machine B IP> 3899 from machine A.

For Linux, the command fails with telnet: Unable to connect to remote host: Connection refused. Therefore, my remote invocation also fails.

What needs to be done on machine A for the remote invocation to work. I tried the following on A with no luck:

iptables -I INPUT -p tcp --dport 3899 -j ACCEPT and
iptables -I FORWARD -p tcp --dport 3899 -j ACCEPT

On machine A, nmap -v localhost -p 3899 does not show anything because there is no service.

An explanation of what I need to do to get this working is appreciated.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Tried to open a port, but nmap says it is still closed ErrorBound Debian 2 06-06-2007 06:41 AM
nmap says every port is open shokora Linux - Security 2 02-16-2007 10:01 AM
nmap shows port 80 open on WAN IP scan. NuxIT Linux - Security 10 06-24-2006 01:21 AM
nmap reports port 21 (ftp) open - how to close it? shazam75 Linux - Security 3 09-23-2005 07:13 PM
firewall.rc.config says :"open port 8080" but nmap says port is closed saavik Linux - Security 2 02-14-2002 12:16 PM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration