LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-11-2007, 01:48 PM   #1
newbe45
Member
 
Registered: Jul 2003
Distribution: fedora, gentoo
Posts: 128

Rep: Reputation: 15
Track open port to application


I recently inherited a file server that is running BSD. There seems to be an FTP service running and I can't seem to find it. Port 21 is open. Doing grepping the running processes for ftp returns nothing. Is there a way I can find out what has port 21 open?
 
Old 09-12-2007, 01:53 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Usually the ftpd service is running through inetd. I.e. when a request reaches port 21 then it's inetd that passes control to ftpd to start the file tranfer. You can read more about inetd here.

Regards
 
Old 09-13-2007, 09:08 AM   #3
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
Check if this works

netstat -anp | grep 21
 
Old 09-13-2007, 11:09 AM   #4
newbe45
Member
 
Registered: Jul 2003
Distribution: fedora, gentoo
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by asimba View Post
Check if this works

netstat -anp | grep 21
Well that pulled up some info that port 21 is in a listening state but no other info.
 
Old 09-14-2007, 12:54 AM   #5
lolo2kx
LQ Newbie
 
Registered: Sep 2007
Posts: 2

Rep: Reputation: 0
Not sure about the BSD side... But from linux I'd go with the lsof utility... Commonly /usr/sbin/lsof or something similiar... Run it and grep the output as mentioned in the other post with netstat...

lsof | grep 21

You may get quite a few results because 21 isn't all that unique but hopefully it will shed some light on your situation...
 
Old 09-14-2007, 11:12 AM   #6
doublejoon
Member
 
Registered: Oct 2003
Location: King George, VA
Distribution: RHEL/CentOS/Scientific/Fedora, LinuxMint
Posts: 370

Rep: Reputation: 44
Code:
lsof -i tcp:21
look at the PID column for Process ID
then
Code:
lsof -p your PID
This should list the full path to the actual daemon and related libraries
 
  


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
LXer: Open XML makes it on to ISO fast track LXer Syndicated Linux News 0 03-14-2007 09:31 AM
LXer: NZ objects to Microsoft Open XML standard fast-track proposal LXer Syndicated Linux News 0 03-11-2007 08:16 PM
LXer: New portal will track Java's evolution into open source LXer Syndicated Linux News 0 08-28-2006 11:54 AM
LXer: Cyber sleuths using open source to track criminals LXer Syndicated Linux News 0 02-16-2006 01:31 PM
cannot SFTP to SUSE 9.2 box, port 22 open, can putty in though using same port. jgrady Linux - Networking 6 03-29-2005 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:14 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
Open Source Consulting | Domain Registration