Using scp between Linux and Mac OS X

For a while, I haven’t been able to get scp to work between Linux and Mac OS X. This only happened when I used the scp command on my Linux box, with Mac OS X acting as the ssh server. Here’s the symptom:

On Linux:

$ scp user@ /tmp/.

It disconnected me after entering my password without transferring the file. In the Gnome File Browser (nautilus), if I tried to connect to the Mac OS X box using ssh:// in the address bar, the gvfsd-sftp process would consume 100% of the CPU until I killed it.

Here’s the solution:

On the Mac OS X computer, in my ~/.bashrc file, I was echo‘ing some text just to say that my .bashrc had been sourced. Removing that echo line fixed the problem and now both the scp command and the Gnome File Browser work just fine.