Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 01-30-2012, 10:08 AM   #1
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
tcpdump over ssh works only some times

I'm trying to send a tcpdump to own computer via ssh, commad:
# mkfifo /tmp/pcap
# ssh root@ "tcpdump -i bge0 -s -0 -w -" > /tmp/pcap
After a short while I'm prompted for password, and then I can use wireshark to capture from /tmp/pcap.
This works a few times, then suddenly it just stalls - nothing happens, I'm not prompted for password, nothing is sent to /tmp/pcap.

I have left the terminal for half an hour, checked my logs (nothing logged anywhere during ssh to other).
/tmp/pcap exists, I have tried creating a new "/tmp/pcap2" and use that, no difference.
I tried against different hosts, no difference.
If I remove the redirect (everything from '>') it works fine - I'm immediately prompted for password, upon login tcpdump starts. (But not sent to /tmp/pcap of course.)

I don't really know how to troubleshoot this, any help is much appreciated!
Old 01-31-2012, 08:19 AM   #2
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Next time, start reading from the named pipe before you begin writing to it, a la:
# cat /tmp/pcap
# ... ssh command here that writes to /tmp/pcap ...
Thing is: why use a named pipe for this at all? tcpdump(1) can write to a capture file for your later review. Or it can simply write to stdout for you to review in a terminal.

Last edited by anomie; 01-31-2012 at 08:21 AM.


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
tcpdump expressions doesn't works properly. sparc86 Linux - Networking 1 11-15-2008 06:46 PM
Hibernate works two times and fails afterwards wild_oscar Linux - Newbie 5 01-15-2008 05:12 AM
tcpdump loops in ssh jmARC Linux - Software 3 03-15-2005 08:47 AM
Only MSN works, everything else on the internet times out. iNf3rn0 Linux - Networking 10 08-27-2004 04:57 PM
Sound only works some times arkamir Linux - Newbie 0 03-12-2004 07:13 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration