1

I want to make a backup from a Synology DiskStation (DSM 6.0.2-8451 Update 9) to a CentOS6 server using Rsync via SSH.

CentOS6 server configuration

/etc/rsyncd.conf

uid = root
gid = root
max connections = 10
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
auth users = synology
secrets file = /etc/rsyncd.secrets
max verbosity = 2
transfer logging = yes

[synology1]
path = /mnt/disk/synology/
hosts allow = xxx.xxx.xxx.xxx (Synology server's IP)
list = true
read only = no

/etc/xinetd.d/rsync

service rsync
{
    disable = no
    flags           = IPv6
    socket_type     = stream
    wait            = no
    user            = root
    server          = /usr/bin/rsync
    server_args     = --daemon
    log_on_failure  += USERID
}

A system user called 'synology' also exists on my system, with a password equal to the rsync user 'synology' provided in /etc/rsyncd.secrets.

I try this from the Synology server:

rsync -av /tmp/try/ [email protected]::synology1 -e 'ssh -v'

and obtain:

OpenSSH_6.8p1-hpn14v6, OpenSSL 1.0.2j-fips 26 Sep 2016
debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port xxxxx.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /var/services/homes/admin/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/services/homes/admin/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/services/homes/admin/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/services/homes/admin/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/services/homes/admin/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/services/homes/admin/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/services/homes/admin/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/services/homes/admin/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.8p1-hpn14v6
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
debug1: Remote is NON-HPN aware
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: AUTH STATE IS 0
debug1: REQUESTED ENC.NAME is 'aes128-ctr'
debug1: kex: server->client aes128-ctr [email protected] none
debug1: REQUESTED ENC.NAME is 'aes128-ctr'
debug1: kex: client->server aes128-ctr [email protected] none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxx
debug1: Host 'xxx.xxx.xxx.xxx' is known and matches the RSA host key.
debug1: Found key in /var/services/homes/admin/.ssh/known_hosts:1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /var/services/homes/admin/.ssh/id_rsa
debug1: Trying private key: /var/services/homes/admin/.ssh/id_dsa
debug1: Trying private key: /var/services/homes/admin/.ssh/id_ecdsa
debug1: Trying private key: /var/services/homes/admin/.ssh/id_ed25519
debug1: Next authentication method: password
[email protected]'s password:
debug1: Authentication succeeded (password).
Authenticated to xxx.xxx.xxx.xxx ([xxx.xxx.xxx.xxx]:xxxxx).
debug1: HPN to Non-HPN Connection
debug1: Final hpn_buffer_size = 2097152
debug1: HPN Disabled: 0, HPN Buffer Size: 2097152
debug1: channel 0: new [client-session]
debug1: Enabled Dynamic Window Scaling
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Sending command: rsync --server --daemon .
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 2872, received 2544 bytes, in 0.2 seconds
Bytes per second: sent 14501.0, received 12844.9
debug1: Exit status 1
rsync error: rsync service is no running (code 43) at io.c(687) [sender=3.0.9]

Ooooh, am I puzzled after various try and hours of blurry googling. Few questions for my sake!

1/ do I actually have to have the same account (user/password) on my CentOS system and on rsync configuration to be able to rsync via ssh?

2/ what's causing my "rsync error: rsync service is no running" here? any idea?

Thanks for any help!

2 Answers 2

3

You may be trying to combine 2 slightly different uses of rsync as a daemon. Your server configuration will respond to requests on the rsync port 873, whereas your command is connecting with -e ssh and so running rsync --server --daemon over that connection instead. If you look at the man page entry for --config=FILE it mentions

The default is /etc/rsyncd.conf unless the daemon is running over a remote shell program and the remote user is not the super-user; in that case the default is rsyncd.conf in the current directory (typi- cally $HOME)

In your case you seem to be using the user synology, so the rsyncd.conf file should probably be in directory ~synology/.

1
  • 1
    Indeed I had to create a new rsyncd.conf in my synology user home, and modify it to indicate files (log, lock, etc.) present in that very folder. Well spotted !
    – Bob
    Commented Feb 15, 2017 at 14:16
1

1/ do I actually have to have the same account (user/password) on my CentOS system and on rsync configuration to be able to rsync via ssh?

No, certainly not.

2/ what's causing my "rsync error: rsync service is no running" here? any idea?

On the server, there is no rsync service running on the server. You most probably miss this part (per the this tutorial):

/etc/rc.d/init.d/xinetd start 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .