Skip to content

Commit 3b84610

Browse files
committed
manpage: clarify remote-shell daemon user@ handling
The description of user@host::module transfers over a remote shell only documented the "ssh -l ssh-user" form, which led readers to conclude that user@ never reaches the remote shell. In fact, for the simple `--rsh=ssh user@host::module` form the user@ prefix is used both as the ssh login user (ssh -l user) and as the rsync-user offered to the module; the two are the same name. rsync only omits its own -l when the remote shell command already specifies one, in which case user@ becomes the rsync-user alone. Spell out the default behaviour and why the explicit -l is needed to use a different ssh login than the rsync-user.
1 parent 9062840 commit 3b84610

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

rsync.1.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,16 +365,26 @@ RSYNC_RSH in the environment will not turn on this functionality.) For example:
365365

366366
> rsync -av --rsh=ssh host::module /dest
367367
368-
If you need to specify a different remote-shell user, keep in mind that the
369-
user@ prefix in front of the host is specifying the rsync-user value (for a
370-
module that requires user-based authentication). This means that you must give
371-
the '-l user' option to ssh when specifying the remote-shell, as in this
372-
example that uses the short version of the [`--rsh`](#opt) option:
368+
A "user@" prefix in front of the host serves two purposes at once in this mode:
369+
it is the rsync-user value (used to log in to a module that requires user-based
370+
authentication) and, by default, it is also passed to the remote shell as the
371+
login user. So the simple form
372+
373+
> rsync -av --rsh=ssh user@host::module /dest
374+
375+
runs `ssh -l user host` and offers "user" as the rsync-user to the module; the
376+
two are forced to be the same name.
377+
378+
If you need the remote-shell (ssh) login to use a different name than the
379+
rsync-user, give an explicit '-l' option to ssh in the remote-shell command.
380+
When ssh is already told which user to log in as, rsync does not add its own
381+
'-l', so the "user@" prefix is then used only as the rsync-user. For example,
382+
using the short version of the [`--rsh`](#opt) option:
373383

374384
> rsync -av -e "ssh -l ssh-user" rsync-user@host::module /dest
375385
376-
The "ssh-user" will be used at the ssh level; the "rsync-user" will be used to
377-
log-in to the "module".
386+
Here "ssh-user" is used at the ssh level while "rsync-user" is used to log in to
387+
the "module".
378388

379389
In this setup, the daemon is started by the ssh command that is accessing the
380390
system (which can be forced via the `~/.ssh/authorized_keys` file, if desired).

0 commit comments

Comments
 (0)