Find PID using a Port?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Find PID using a Port?
# 1  
Old 04-29-2013
Hammer & Screwdriver Find PID using a Port?

Hi,

I do not have root user credentials nor do I have the functional id of the process that uses port 80.

How can I find the pid of the process using the port number 80 ?

Operating System: Linux

Last edited by mohtashims; 04-29-2013 at 11:21 AM..
# 2  
Old 04-29-2013
Port 80? Almost certainly your webserver, whatever it is. If it's apache, the PID may be in /var/run/apache.pid or the like.
# 3  
Old 04-29-2013
As far as mapping a socket to its owner, I believe that requires privilege.

What is it that you are trying to accomplish? I mean the bigger picture. Perhaps there is another way to get it done.

Regards,
Alister
# 4  
Old 04-30-2013
Quote:
Originally Posted by alister
As far as mapping a socket to its owner, I believe that requires privilege.

What is it that you are trying to accomplish? I mean the bigger picture. Perhaps there is another way to get it done.

Regards,
Alister

I have a web url like www.central-mosque.com

I want to figure out which application server they are using to host the website.
# 5  
Old 04-30-2013
Mohtashims,

try
Quote:
uptime.netcraft.com
for such queries on identifying the information for web servers...

---------- Post updated at 01:07 PM ---------- Previous update was at 01:05 PM ----------

try using
Code:
 'lsof -i:80'

for identifying what is using the port 80
# 6  
Old 04-30-2013
Quote:
Originally Posted by busyboy
Code:
 'lsof -i:80'

for identifying what is using the port 80
That should work... if he had root acccess.

Port 80 is almost always used by a web server however there's a small chance you have a non-standard configuration; unfortunately we cannot just assume yours is the same case.

Perhaps you can run nmap from a different server in the same network and query the original server to see if it indeed responds to HTTP requests.

Now, getting the PID would be another story.
# 7  
Old 05-02-2013
based on the query, this is what I understood.

@Mohtashims, are you looking for something like this or its still unclear.

Regards,
Nasir
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash script, find the next closed (not in use) port from some port range.

hi, i would like to create a bash script that check which port in my Linux server are closed (not in use) from a specific range, port range (3000-3010). the print output need to be only 1 port, and it will be nice if the output will be saved as a variable or in same file. my code is: ... (2 Replies)
Discussion started by: yossi
2 Replies

2. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

3. HP-UX

Find port for Pid

Hi, Is this the most appropriate way of finding the listen port number given the pid is "16659" ? lsof -Pan -i tcp -i udp | grep 16659 | grep -i "listen"If so, how can I extract "7001" and assign it to a variable say myport=7001 from the below output which happens to be actual port number? ... (1 Reply)
Discussion started by: mohtashims
1 Replies

4. UNIX for Dummies Questions & Answers

Find PID for a port

Hi, I need to find the PID for a given port on the below system. HP-UX mymachine B.11.31 U ia64 3223107173 unlimited-user license How can I ? (4 Replies)
Discussion started by: mohtashims
4 Replies

5. Shell Programming and Scripting

Get opened port with given PID?

i want to get tomcat listening port , from a command. ps -ef | grep catalina | grep -v "grep catalina" | grep -v "catalina.out" | awk '{print $2}' | head -1 output : ----- 1234 Now with this 1234 i need to know , in which port my tomcat is running... i tried , netstat -ao | grep... (14 Replies)
Discussion started by: linuxadmin
14 Replies

6. UNIX for Dummies Questions & Answers

pid from port number in AIX

Hello guys, How to shut down a port number in AIX. May be first I need to find out what is the process ID of that process that listens to this particular port.. Is there any command to find a process ID from the port number other than "lsof". thanks (1 Reply)
Discussion started by: solaix14
1 Replies

7. Shell Programming and Scripting

how to find only PID value

When I run ps -aef | grep aaa.exe it gives out put user 5091 5518 0 10:13:25 pts/1 0:00 grep aaa.exe user 4647 2479 0 09:26:31 ? 0:25 /kk/zzz/user/xxx/bin/aaa.exe user1 1111 2222 0 08:26:31 ? 0:25 /kk/zzz/user1/xxx/bin/aaa.exe I need Only PID value ie... (5 Replies)
Discussion started by: madhusmita
5 Replies

8. HP-UX

To find pid from port number

Hi, I am working on HP-UX Release 11i. I want to find the process id (PID) of the process running on a particular port. lsof command fuser does not work on this system. Please suggest some alternative. Thanks (6 Replies)
Discussion started by: gmat
6 Replies
Login or Register to Ask a Question