I can connect to my server using
ssh dziura and it works as it should, but I have problems copying any files to/from the server using rsync/scp/sftp.
$ scp dziura:/home/kossak/file_remote.txt . $ scp ./file_local.txt dziura:/home/kossak/ lost connection
The first command returns 0 status, doesn't show any messages/errors and the file "file_remote.txt" is NOT copied to my local directory (I have rwx permissions to my local dir). The second command returns "lost connection"
$ rsync -Lr --partial --progress --rsh=ssh dziura:/home/kossak/file_remote.txt . rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receiver=3.1.0]
$ sftp dziura Connection closed
I also checked
/var/log/auth.log file (on the server) after running first scp command and it had lines:
Oct 27 20:26:37 dziura sshd: Accepted publickey for kossak from <MY_IP> port 34583 ssh2: RSA <...> Oct 27 20:26:37 dziura sshd: pam_unix(sshd:session): session opened for user kossak by (uid=0) Oct 27 20:26:38 dziura sshd: Received disconnect from <MY_IP>: 11: disconnected by user Oct 27 20:26:38 dziura sshd: pam_unix(sshd:session): session closed for user kossak
SSH on the remote server works on standard 22 port.
I have root access to local and remote machines.
The remote server runs Ubuntu 14.04.3 LTS.
Locally I use Linux Mint 17.2.
Server name "dziura" is in
Host dziura HostName <IP_GOES_HERE> User kossak IdentityFile /home/kossak/.ssh/id_rsa_enc
Verbose log from
scp -vvv dziura:/home/kossak/file_remote.txt .: http://pastebin.com/0DkeHEC3
Any ideas how to fix this problem? Thank you.
-- EDIT --
I run my sshd in debug mode via:
sudo /usr/sbin/sshd -p 2222 -D -d -e and from my local machine i tried to scp file:
scp -P 2222 file_local.txt dziura:. The log on the remote server was: http://pastebin.com/xxji6ucL
Scp command also displayed some environmental variables before showing "lost connection".
Here's more verbose debugging: http://pastebin.com/HiJ8qB0Y