Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Can't tell whether lsof -i connections are coming in or going out Post 302501207 by Corona688 on Thursday 3rd of March 2011 01:49:40 AM
Old 03-03-2011
TCP connections do communicate in both directions.

If you're wondering which server initiated the connection(i.e. did you connect to them, or they to you?) you can check the port number. Connections you created to something else should have random, high port numbers between 32768 and 65535 on your end of the connection, and low port numbers on their end. (http is port 80, imaps is 993 -- you'll find the names in /etc/services).

So it looks like you initiated all these connections, some to websites, some to email.
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

lsof

Could someone please give me a step for a hint on which version and where is the above utility is for version 4.3.3.0 of Aix. (1 Reply)
Discussion started by: jacl
1 Replies

2. AIX

command lsof

hello Sorry but i don't understand very well the lsof command with the man. Can you explain to me what is the use of this command ? thank you (2 Replies)
Discussion started by: pascalbout
2 Replies

3. UNIX for Dummies Questions & Answers

lsof ???

Hi All, I'm having a problem with "lsof" in HP-UX system. Its giving me 2 two different results when running it. 1 . lsof -p 'PID' | wc -l -----gives some value 2 . lsof | grep 'PID' | wc -l The above two commands gives me two different values with the same PID...... Thanks (6 Replies)
Discussion started by: marc
6 Replies

4. Shell Programming and Scripting

lsof in solaris

Hi .. I have written a cronjob to invoke a script that would transfer files based on some criteria. Consider folders A and B. Say I FTP a large file to A. Before the file gets fully transfered say the cronjob gets invoked. The script will move the file before its fully transfered. To detect... (1 Reply)
Discussion started by: champak
1 Replies

5. HP-UX

lsof on HPUX 11.23

Hey Guys... I am looking for lsof by HPUX 11.23 . Could someone said me where can download it? Thanks in Advance. ANGEL GADEA (3 Replies)
Discussion started by: aggadtech08
3 Replies

6. UNIX for Dummies Questions & Answers

lsof

I'm looking to list all of the files open at a certain time up on a UNIX box. From looking on the internet, it looks as though lsof is the most common. However have tried this and got the following: ksh: lsof: not found Now having gone into bash mode and hit tab twice I see that lsof... (3 Replies)
Discussion started by: meevagh
3 Replies

7. UNIX for Dummies Questions & Answers

about lsof

Hi, I typed lsof -i :80 in my putty but i am not able to get sockets related to port 80 Can any one help me out soon Can anyone point out the reason for not able to get the related sockets Output of what i am getting in my putty is displayed below training@use:~> lsof -i :80... (4 Replies)
Discussion started by: satheeshkr_cse
4 Replies

8. HP-UX

lsof in HP-UX

In Linux and Solaris lsof accepts the -X switch which allows to see if deleted files are still in use and eat disk space. In HP-UX it is now working and it is a problem... today one of my filesystems on the server was increasing very fast but existing file sizes were not really changing. lsof shows... (3 Replies)
Discussion started by: Vorb
3 Replies

9. OS X (Apple)

Lsof output

This is abridged lsof output from my safari process: Safari 13063 owner 9u unix 0x982ef3b9c1be1293 0t0 ->0x982ef3b9b7534eab Safari 13063 owner 10u unix 0x982ef3b9c1be0933 0t0 ->0x982ef3b9c1be1423 Safari 13063 owner 11u unix 0x982ef3b9c1be1423 ... (1 Reply)
Discussion started by: sakurashinken
1 Replies

10. Shell Programming and Scripting

Lsof command

Hi, I am trying to find the files in a specific directory that are currently in open state. I need this information to archive the old files that are not active in the directory. I get the following output when I try the command $ lsof +d '/var/tmp/'|awk '{print $9}'|sort -u NAME... (1 Reply)
Discussion started by: ryzen7
1 Replies
TCPSPY.RULES(5) 						   tcpspy.rules 						   TCPSPY.RULES(5)

NAME
tcpspy.rules - configuration file for tcpspy DESCRIPTION
This file, by default /etc/tcpspy.rules, is read by the /etc/init.d/tcpspy script at init time in order to configure tcpspy (see tcpspy(8)) logger filtering rules. It might look like: # /etc/tcpspt.rules example user "joedoe" and rport 22 and raddr 192.168.1.10 user 1003 lport 22 or lport 21 (lport 23 and user "joedoe") or raddr 192.168.1.20 This rules file specifies that tcpspy logs tcp connections according to 4 rules (line 1 to line 4 - one per each line) using the boolean logic (see below) to evaluate each rule. This particular example logs conections: line 1 - for user "joedoe" connecting to 192.168.1.10:22 (remote) line 2 - for user whose UID is 1003 line 3 - to localhost:22 or localhost:21 line 4 - for user "joedoe" to localhost:23 or to 192.168.1.20 (remote) Everything from an "#" signal and the end of the line will not be evaluated. Rule Syntax - just extracted from tcpspy(8) A rule may be specified with the following comparison operators: user uid True if the local user initiating or accepting the connection has the effective user id uid. user "username" Same as above, but using a username instead of a user id. lport port True if the local end of the connection has port number port. lport [low] - [high] True if the local end of the connection has a port number greater than or equal to low and less than or equal to high. If the form low- is used, high is assumed to be 65535. If the form -high is used, low is assumed to be 0. It is an error to omit both low and high. lport "service" Same as above, but using a service name from /etc/services instead of a port number. rport Same as lport but compares the port number of the remote end of the connection. laddr n.n.n.n[/m.m.m.m] Interpreted as a "net/mask" expression; true if "net" is equal to the bitwise AND of the local address of the connection and "mask". If no mask is specified, a default mask with all bits set (255.255.255.255) is used. raddr Same as laddr but compares the remote address. exe "pattern" True if the full filename (including directory) of the executable that created/accepted the connection matches pattern, a glob(7)-style wildcard pattern. The pattern "" (an empty string) matches connections created/accepted by processes whose executable filename is unknown. If the -p option is not specified, a warning message will be printed, and the result of this comparison will always be true. Expressions (including the comparisons listed above) may be joined together with the following logical operations: expr1 or expr2 True if either of expr1 or expr2 are true (logical OR). expr1 and expr2 True if both expr1 and expr2 are true (logical AND). not expr True if expr is false (logical NOT). Rules are evaluated from left to right. Whitespace (space, tab and newline) characters are ignored between "words". Rules consisting of only whitespace match no connections, but do not cause an error. Parentheses, '(' and ')' may be placed around expressions to affect the order of evaluation. Examples These are some sample rules which further demonstrate how they are constructed: user "joe" and rport "ssh" Log connections made by user "joe" for the service "ssh". not raddr 10.0.0.0/255.0.0.0 and rport 25 and (user "bob" or user "joe") Log connections made by users "bob" and "joe" to remote port 25 on machines not on a fictional "intranet". AUTHOR
Tim J. Robbins (tcpspy), Pablo Lorenzzoni (this manpage) SEE ALSO
glob(7), proc(5), services(5), signal(7), syslog(3), tcpspy(8) Spectra April 2001 TCPSPY.RULES(5)
All times are GMT -4. The time now is 05:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy