0

I am trying to copy directories from one server to another using rsync using:

rsync -avr /home/<username> <username>@111.111.111.11:/home/<username>/

I get this error (on the sending server):

/etc/ssh/ssh_config: line 54: Bad configuration option: clientaliveinterval
/etc/ssh/ssh_config: line 55: Bad configuration option: clientalivecountmax
/etc/ssh/ssh_config: terminating, 2 bad configuration options
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.3]

I have been searching all over Google and Stack for solutions to this, only to find unprofessional, 1-line, vague answers (that all fail of course). I understand it has something to with adding:

ClientAliveInterval
ClientAliveCountmax

or

ServerAliveInterval
ServerAliveCountMax

to the ssh_config and/or or sshd_config files on one and/or both servers...

I have rsync installed on both servers. So here are my questions:

What needs to change on the Sending server in the following files:

/etc/ssh/ssh_config
/etc/ssh/sshd_config

What needs to change on the Target server in the following files:

/etc/ssh/ssh_config
/etc/ssh/sshd_config
peppy
  • 73
  • 2
  • 10
  • 1
    All of your errors appear to be for lines in `/etc/ssh/ssh_config` which should answer roughly 50% of your question: nothing in`/etc/ssh/sshd_config` is relevant. It looks as if the errors are on the client side, so just delete the offending lines and move on. – larsks Oct 15 '22 at 00:47
  • I'm assuming the "client side" is the "target/receiving" server? I deleted the ClientAliveInterval and ClientAliveCountmax and that didn't work. – peppy Oct 15 '22 at 01:32
  • 1
    The "client" is the one that runs `ssh`; the "server" is the one that is receiving the ssh connection with `sshd`. That means the client is one *initiating* the connection. – larsks Oct 15 '22 at 01:45
  • Thanks for the help, I deleted those lines and everything started working! – peppy Oct 15 '22 at 02:07

0 Answers0