SCP returns protocol error: unexpected < newline >

SCP Protocol Error: Unexpected & LT; newline>

Let’s not talk about the reasons, but the solutions:
It’s because the.bashrc or.bash_profie on your SCP remote server is using echo or printf to print out characters.
Just log in to the remote server and modify the.bashrc or.bash_profie to print out the # comment.

Read More: