data synchronization between servers using rsync

Discussion in 'Server Operation' started by Poliman, Jun 6, 2018.

  1. Poliman

    Poliman Member

    Hi. I have three servers - lets say - clo1, bh1, wal1. I log in to first one using username and ssh key, to second I use login and password. Last is local server in my company. Each under Linux Ubuntu. I send data from wal1 to bh1 using rsync (I added ssh key to authorized_keys file on bh1 server on wallramcte account):
    rsync -avz -e "ssh -p 33222" /var/lib/automysqlbackup/daily/wallram/ [email protected]:/home/wallramcte/backups/
    This works perfectly. Unfortunately I will shutdown soon bh1 server and I would like to synchronize data this same way like above (I added ssh key to authorized_keys file on clo1 server on wallramcte_sh account). I used command:
    rsync -avz -e "ssh -p 5688" /var/lib/automysqlbackup/daily/wallram/ [email protected]:/home/wallramcte_sh/backups/
    but after maybe 30s I have message:
    ssh: connect to host Y.Y.Y.Y port 5688: Connection timed out
    rsync: connection unexpectedly closed (0 bytes received so far) [sender]
    rsync error: unexplained error (code 255) at io.c(605) [sender=3.0.9]
    One difference between clo1 and bh1 is login technique. To clo1 is used login and ssh key authorize user but on bh1 is used login and password. How to bypass this?

    Both rsync commands executed on wal1 server.
  2. ISPConfig Developer ISPConfig Developer

  3. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Obviously you cannot rsync simply because it requires a password. Though there is other way around, the best is just add the ssh key like you added to the other one.
  4. Poliman

    Poliman Member

    Yes and as I mentioned above I added ssh key but there is some problem. I suppose the source of this problem is authorization. I log into one server using ssh cert (without password, I just put root in putty console) and here it does not work. On second server with logging using root and password I can do it without any problem after adding ssh key to authorized_keys file. :)

    I will check the links from soon. From 6th Juni I have incredibly much work in my job.

Share This Page