If your scp
fails with a Connection closed
message, then add a -v
to your options,
scp -p -v myfile.txt user@host:/home/user/Downloads/
to see if you get something like the following:
debug1: Sending subsystem: sftp debug1: client_global_hostkeys_private_confirm: server used untrusted RSA signature algorithm ssh-rsa for key 0, disregarding debug1: update_known_hosts: known hosts file /home/xmas/.ssh/known_hosts2 does not exist Connection closed
If you see the Sending subsystem: sftp
message, then there is a discrepancy between your versions of ssh.
Until you get them all up to the same level, where they are using sftp,
add -O
(dash Oh) to your scp
options to override and use the old way of transfer. You can find more information on -O
in your system's man pages.
-O Use the original SCP protocol for file transfers instead of the SFTP protocol. Forcing the use of the SCP protocol may be neces- sary for servers that do not implement SFTP, for backwards-com- patibility for particular filename wildcard patterns and for ex- panding paths with a '~' prefix for older SFTP servers. This mode is the default.