I recently ran across this and found this very helpful post: http://lists.freebsd.org/pipermail/freebsd-questions/2004-February/035618.html
> Are you using bash ?
> If ~/.bashrc generates ANY output, it WILL break the scp and rcp commands.
And there’s nothing about this specific to bash, either; on any shell,
from the startup scripts
in a non-interactive shell
WILL break the scp and rcp commands.
Turns out if /etc/bashrc outputs anything either this will cause scp to fail as well! We have a password expiry that is showed if a users password is going to expire within 30 days. Commented out the warning in /etc/bashrc and scp worked like a charm!