Monitor connections to iTunes4 sharing - method #2

May 02, '03 09:51:00AM

Contributed by: mithras

With the release of iTunes 4, interest in library sharing is growing. The iTunes Sharing preference pane tells you how many people are connected to your library, but not who they are. Here's a one-line terminal command (shown on two with the "" continuation character, so cut and paste should work) to show who is browsing your iTunes library:


  netstat -f inet -W | awk '$4 ~ /3689/ {print "iTunes connection from: "$5}' \
  | sed -e 's/\.[^.]*$//g'
If you want to kick off a specific user, all I can think to do is to add a rule to your firewall:
  sudo ipfw add deny tcp from (user) to any 3689
This blocks connections from that user to your iTunes sharing port. If anyone has further ideas or wants to wrap this into a pretty app, I'd love to see it!

PS: Note that sharing your library with strangers may violate the iTunes EULA; it may or may not fall under the "personal use" that you "click agree" to when you turn on the sharing feature. Share at your own risk.

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030430103946205