Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
scp file.txt user1@

Each time when I issue this SCP command, I get

Connection to closed by remote host.
lost connection.

Why is this happening??

share|improve this question

migrated from May 29 '12 at 0:32

This question came from our site for professional and enthusiast programmers.

Check whether you can ping to that host or not? – Chronicles May 28 '12 at 7:35
Does "user" have access to this directory ? Does the directory exists ? – Luc M May 29 '12 at 1:02

Make sure the user account you're using on the remote machine has its default shell set to a valid value (e.g. /bin/bash).

To check the currently set shell use:

grep <username> /etc/passwd 

(the last value in the row is the default shell). To change this value use:

chsh -s /bin/bash <username>
share|improve this answer

Your Answer


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