Is it possible to specify a different ssh port when using rsync?

后端 未结 8 2078
感动是毒
感动是毒 2020-12-12 08:44

I have been attempting the following command:

rsync -rvz --progress --remove-sent-files ./dir user@host:2222/path

SSH is running on port

8条回答
  •  隐瞒了意图╮
    2020-12-12 09:38

    The correct syntax is to tell Rsync to use a custom SSH command (adding -p 2222), which creates a secure tunnel to remote side using SSH, then connects via localhost:873

    rsync -rvz --progress --remove-sent-files -e "ssh -p 2222" ./dir user@host/path

    Rsync runs as a daemon on TCP port 873, which is not secure.

    From Rsync man:

    Push: rsync [OPTION...] SRC... [USER@]HOST:DEST

    Which misleads people to try this:

    rsync -rvz --progress --remove-sent-files ./dir user@host:2222/path

    However, that is instructing it to connect to Rsync daemon on port 2222, which is not there.

提交回复
热议问题