"To be a warrior is not a simple matter of wishing to be one. It is rather an endless struggle that will go on to the very last moment of our lives. Nobody is born a warrior, in exactly the same way that nobody is born an average man. We make ourselves into one or the other." --Kokoro
The main problem is that you have to exclude the traffic generated by the ssh session from capturing. Several patches are available to do this, but excluding port 22 is probably the easiest solution for now.
The second problem is that ssh cannot ask for a password on stdin. You should either set up ssh-agent, or setup passwordless ssh keys , so that you don’t need a password.
This can be worked around by combining SSH with a FIFO, this is typically how I setup my sessions.
1
2
3
$mkfifo/tmp/sharksess
$wireshark-k-i/tmp/sharksess&
$ssh user@remote-host"tcpdump -w - not port 22">/tmp/sharksess