Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

up vote 2 down vote accepted

the problem was a personalized welcome message of bash

share|improve this answer
4  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.