1 This is kind of informal and may be wrong, but it helped me. It's
2 basically a summary of clientserver.c and authenticate.c.
4 -- Martin Pool <mbp@samba.org>
11 This is the protocol used for rsync --daemon; i.e. connections to port
12 873 rather than invocations over a remote shell.
14 When the server accepts a connection, it prints a greeting
18 where <version> is the numeric version; currently 24. It follows this
19 with a free text message-of-the-day. It expects to see a similar
20 greeting back from the client.
22 The server is now in the connected state. The client can either send
27 to get a listing of modules, or the name of a module. After this, the
28 connection is now bound to a particular module. Access per host for
29 this module is now checked, as is per-module connection limits.
31 If authentication is required to use this module, the server will say
33 @RSYNCD: AUTHREQD <challenge>
35 where <challenge> is a random string of base64 characters. The client
40 where <user> is the username they claim to be, and <response> is the
41 base64 form of the MD4 hash of challenge+password.
43 At this point the server applies all remaining constraints before
44 handing control to the client, including switching uid/gid, setting up
45 include and exclude lists, moving to the root of the module, and doing
48 If the login is acceptable, then the server will respond with
52 The client now writes some rsync options, as if it were remotely
53 executing the command. The server parses these arguments as if it had
54 just been invoked with them, but they're added to the existing state.
55 So if the client specifies a list of files to be included or excluded,
56 they'll defer to existing limits specified in the server
59 At this point the client and server both switch to using a
60 multiplexing layer across the socket. The main point of this is to
61 allow the server to asynchronously pass errors back, while still
62 allowing streamed and pipelined data.
64 The server then talks to the client as normal across the socket,
65 passing checksums, file lists and so on. For documentation of that,
66 stay tuned (or write it yourself!).