Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
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

1 Answer 1

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.