Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update entrypoint.sh #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jeroenst
Copy link

some hosts can't connect because logging is logged to stdout instead of stderr causing clients to be confused about welcome message.

rsync: server sent "2024/09/25 19:21:37 [519] name lookup failed for 172.30.30.100: Name or service not known" rather than greeting
rsync error: error starting client-server protocol (code 5) at main.c(1863) [Receiver=3.2.7]

@srstsavage
Copy link
Member

So far I'm unable to replicate this issue. Can you provide more details, including the exact commands you're using to run both the rsync-server Docker container and your rsync client command (with any secrets or sensitive information redacted), and also the OS of the rsync client. Thank you.

@jeroenst
Copy link
Author

jeroenst commented Sep 26, 2024

Synology NAS rsync via HyperBackup fails due to this issue.

Here is the full log:

rsync --debug=connect -e 'ssh -v -p 13337' rsync://root@localhost/
OpenSSH_8.2p1 Ubuntu-4ubuntu0.11, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to localhost [::1] port 874.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type 0
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa_sk type -1
debug1: identity file /root/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_ed25519_sk type -1
debug1: identity file /root/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.11
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.4p1 Debian-5+deb11u3
debug1: match: OpenSSH_8.4p1 Debian-5+deb11u3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to localhost:874 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:2K8LYdaQEvmyNriR2P3KoDLRI+9jKjzJYTAllc7ROPM
debug1: Host '[localhost]:874' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:59
debug1: resetting send seqnr 3
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: resetting read seqnr 3
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /root/.ssh/id_rsa RSA SHA256:7DuyzbjSi7nY0iueOc96h98ParV9ibB1b5l6ZeVWiAk
debug1: Will attempt key: /root/.ssh/id_dsa
debug1: Will attempt key: /root/.ssh/id_ecdsa
debug1: Will attempt key: /root/.ssh/id_ecdsa_sk
debug1: Will attempt key: /root/.ssh/id_ed25519
debug1: Will attempt key: /root/.ssh/id_ed25519_sk
debug1: Will attempt key: /root/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /root/.ssh/id_rsa RSA SHA256:7DuyzbjSi7nY0iueOc96h98ParV9ibB1b5l6ZeVWiAk
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ecdsa_sk
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: Trying private key: /root/.ssh/id_ed25519_sk
debug1: Trying private key: /root/.ssh/id_xmss
debug1: Next authentication method: password
root@localhost's password:
debug1: Authentication succeeded (password).
Authenticated to localhost ([::1]:874).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Sending environment.
debug1: Sending env LC_ADDRESS = nl_NL.UTF-8
debug1: Sending env LC_NAME = nl_NL.UTF-8
debug1: Sending env LC_MONETARY = nl_NL.UTF-8
debug1: Sending env LC_PAPER = nl_NL.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_IDENTIFICATION = nl_NL.UTF-8
debug1: Sending env LC_TELEPHONE = nl_NL.UTF-8
debug1: Sending env LC_MEASUREMENT = nl_NL.UTF-8
debug1: Sending env LC_NUMERIC = nl_NL.UTF-8
debug1: Sending command: rsync --server --daemon .
rsync: server sent "2024/09/26 10:32:58 [72] name lookup failed for 172.18.0.1: Name or service not known" rather than greeting
rsync error: error starting client-server protocol (code 5) at main.c(1680) [Receiver=3.1.3]

with log to stderr instead of stdout:

 rsync --debug=connect -e 'ssh -v -p 13337' rsync://root@localhost/
OpenSSH_8.2p1 Ubuntu-4ubuntu0.11, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to localhost [::1] port 13337.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type 0
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa_sk type -1
debug1: identity file /root/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_ed25519_sk type -1
debug1: identity file /root/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.11
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.4p1 Debian-5+deb11u3
debug1: match: OpenSSH_8.4p1 Debian-5+deb11u3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to localhost:13337 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:2K8LYdaQEvmyNriR2P3KoDLRI+9jKjzJYTAllc7ROPM
debug1: checking without port identifier
The authenticity of host '[localhost]:13337 ([::1]:13337)' can't be established.
ECDSA key fingerprint is SHA256:2K8LYdahemciremdiP3KoDLRI+9jKjzJYTAllc7ROPM.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[localhost]:13337' (ECDSA) to the list of known hosts.
debug1: resetting send seqnr 3
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: resetting read seqnr 3
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /root/.ssh/id_rsa RSA SHA256:7DuyzbjSi7nY0iueOc96h98ParV9ibB1b5l6ZeVWiAk
debug1: Will attempt key: /root/.ssh/id_dsa
debug1: Will attempt key: /root/.ssh/id_ecdsa
debug1: Will attempt key: /root/.ssh/id_ecdsa_sk
debug1: Will attempt key: /root/.ssh/id_ed25519
debug1: Will attempt key: /root/.ssh/id_ed25519_sk
debug1: Will attempt key: /root/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /root/.ssh/id_rsa RSA SHA256:7DuyzbjSi7nY0iueOc96h98ParV9ibB1b5l6ZeVWiAk
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ecdsa_sk
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: Trying private key: /root/.ssh/id_ed25519_sk
debug1: Trying private key: /root/.ssh/id_xmss
debug1: Next authentication method: password
root@localhost's password:
debug1: Authentication succeeded (password).
Authenticated to localhost ([::1]:13337).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Sending environment.
debug1: Sending env LC_ADDRESS = nl_NL.UTF-8
debug1: Sending env LC_NAME = nl_NL.UTF-8
debug1: Sending env LC_MONETARY = nl_NL.UTF-8
debug1: Sending env LC_PAPER = nl_NL.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_IDENTIFICATION = nl_NL.UTF-8
debug1: Sending env LC_TELEPHONE = nl_NL.UTF-8
debug1: Sending env LC_MEASUREMENT = nl_NL.UTF-8
debug1: Sending env LC_NUMERIC = nl_NL.UTF-8
debug1: Sending command: rsync --server --daemon .
2024/09/26 10:34:35 [551] name lookup failed for 172.18.0.1: Name or service not known
2024/09/26 10:34:35 [551] connect from UNKNOWN (172.18.0.1)
2024/09/26 10:34:35 [551] module-list request from UNKNOWN (172.18.0.1)
data            /data directory
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
Transferred: sent 3052, received 2900 bytes, in 0.1 seconds
Bytes per second: sent 22657.6, received 21529.1
debug1: Exit status 255
root@server:/opt/docker#

@jeroenst
Copy link
Author

jeroenst commented Oct 4, 2024

Here is the docker compose section of rsync server:


  rsync-server:
    container_name: rsync-server
    image: axiom/rsync-server
    restart: unless-stopped
    ports:
      - '13337:22'
    volumes:
      - '/mnt/hd1/rsync/getpraut:/data'
      - '/opt/docker/rsyncd/ssh:/root/.ssh'
    environment:
      - 'TZ=Europe/Amsterdam'
      - 'USERNAME=root'
      - 'PASSWORD=XXXXXXXXXXXX'
      - 'ALLOW=*'
      - 'DENY=192.168.255.254/32'
    networks:
      static:
        ipv4_address: 172.18.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants