5

Good day everyone. I’m trying to rsync to my Manjaro server over ssh. Nothing fancy, just a single PNG in order to verify that it works. I’m using a basic password authentication in order to verify that I can get it functioning before I start packing on extra security.

rsync -v -e ssh /home/john/rsyncdemo/rsyncdemo2/saved.png sshuser@192.162.2.187:/home/sshuser/Desktop/rsyncdemo/rsyncdemo2/saved.png

When I do that, about 10 seconds go by until I receive the following error.

ssh: connect to host 192.162.2.187 port 22: Connection timed out
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]

I’m no stranger to ssh but this is something beyond my modest understanding of the deep inner workings. I googled the problem but I didn’t want to throw arbitrary solutions at my system without first understanding the problem. I’ll explain what I have done in order to gather more information. I have 3 systems.

  1. Win10-PC with Cygwin (fully updated) (Atheros Wireless)
  2. Arch-Laptop (fully updated) (Atheros Wireless)
  3. Manjaro-Server (fully updated) (Wired)

+router

  • ASUS RT-N10P

First thing I checked was sshd. Enabled and restarted sshd on all 3 machines. It’s worth noting that my Manjaro is a brand spanking new install. Arch has been modified but the system is very minimal. Cygwin is also new but It’s been awhile since I reinstalled Windows and I have a few things running in the background. I also forwarded the ports and disabled the firewall on my router.

Ran the three commands.

ssh sshuser@192.162.2.187

rsync -r /cygdrive/c/Users/John/Desktop/rsyncdemo/ /cygdrive/e/rsyncdemo/

scp /cygdrive/c/Users/John/Desktop/rsyncdemo/rsyncdemo2/saved.png sshuser@192.168.2.187:/home/sshuser/Desktop/rsyncdemo/rsyncdemo2/

All of these commands work. What that means is that: logging into the machine via ssh works, copying files to the server works and rsync works. The problem exists when I try to rsync via ssh. One of two possibilities exists. Either there is something wrong with the server, or I missed some fundamental step in configuring ssh on both client computers. It’s more likely the former. Like I said, I had prior experience setting up ssh and it wasn’t that hard the first few times. I started by checking the ssh and rsync versions I was running.

Win10-PC (sshd enabled and started)

OpenSSH_7.5p1, OpenSSL 1.0.2k  26 Jan 2017

Arch-Laptop (sshd enabled and started)

OpenSSH_7.5p1, OpenSSL 1.1.0f  25 May 2017

Manjaro-Server (sshd enabled and started)

OpenSSH_7.5p1, OpenSSL 1.1.0f  25 May 2017

All 3 machines

rsync  version 3.1.2  protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, prealloc

You may have noticed the Cygwin version of openssl is not as high as the other two. I don’t think this could cause the problem since Arch also can not connect to the network. Like I said before, Either there is something wrong with the server, or I missed some fundamental step in configuring ssh on both client computers.

I also read this thread but I'm not sure if the chosen answer wants me to configure the ssh_config file on the host of the client. In either case, a simple png should not take this long to rsync so I doubt it has anything to do with the problem but I'll leave it here in just in case

rsync timed out

If you have an answer off the top of your head, awesome. If you don’t, then posting something that can help further isolate the problem would be equally appreciated. Thank you so much for your help.

closed as off-topic by Kusalananda, Jeff Schaller, Rui F Ribeiro, Sparhawk, jimmij Feb 12 at 10:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Kusalananda, Jeff Schaller, Rui F Ribeiro, Sparhawk, jimmij
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Try this: rsync -azvP -e 'ssh -p22' /home/john/rsyncdemo/rsyncdemo2/saved.png sshuser@192.162.2.187:/home/sshuser/Desktop/rsyncdemo/rsyncdemo2/saved.png – Prince Adeyemi Sep 2 '17 at 6:01
  • 1
    While this probably won't make any difference, try running rsync with more -v flags. And congratulations on a well written question. – Faheem Mitha Sep 2 '17 at 6:07
  • 2
    I'm unclear on your layout. You mentioned three machines. You are sshing to a machine running Manjaro. But it's not clear from you are sshing from. You mention two other machines. And the relationship of the router to these machines isn't clear either. Are all three machines plugged into the same router? Also, it's normally 192.168, not 192.162. You've written 168 in one place, so I assume this is a typo. – Faheem Mitha Sep 2 '17 at 6:13
  • 2 things to continue the investigation: 1. tcpdump on client and servers to investigate a network issue, and possibly check which end is stopping the TCP/SSH session. 2. Running ssh in verbose mode using -e "ssh -vvv" – Gohu Sep 2 '17 at 7:08
  • 1
    I figured out the problem. The problem is I'm an idiot. Faheem was right. I had 162 as the second subnet. Funny thing is, I was compulsively checking the IP because other people's solution was that the IP changed on them overnight. But I was only checking the last subnet. Faheem can add the awnser and I'll close out the ticket. – user21303 Sep 2 '17 at 17:29
0

It happens when the IP address is incorrect:

ssh: connect to host **192.168.1.146** port 22: Connection timed out
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.2]

root@arc:/home/arc# rsync -rvzaX --delete /home/arc/nikhil/ \backupserver@**192.168.0.146**:/home/backupserver/mega
backupserver@192.168.0.146's password:
sending incremental file list
created directory /home/backupserver/mega
./
Nikhil Daily Tracking Sheet_2018.xlsx

sent 6,896 bytes  received 84 bytes  1,073.85 bytes/sec
total size is 9,975  speedup is 1.43

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