Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

when I try a scp transfer I get this error:

protocol error: bad mode

PD: I can establish a ssh connection.

share|improve this question
Does it make a difference if you do scp -1 or scp -2? – Dennis Williamson Mar 12 '11 at 1:47
up vote 2 down vote accepted

the problem was a personalized welcome message of bash

share|improve this answer
So what's the solution? If you can't change the welcome message, is there a way to still scp? – Thucydides411 May 5 '14 at 16:26

So, this is a bit of question necromancy, but since I got here, and then realised what the answer was after reading the first answer, I figured I'd put this here for other wayward souls.

Because of the way scp works (over stdin/stdout over ssh AFAIK), having a naive bashrc that prints messages breaks the formatting scp is expecting, and thus the connection.

As suggested in various answers elsewhere (linked below), modifying your dot-files is usually the way to fix this:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .