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

后端 未结 8 2074
感动是毒
感动是毒 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:35

    Another option, in the host you run rsync from, set the port in the ssh config file, ie:

    cat ~/.ssh/config
    Host host
        Port 2222
    

    Then rsync over ssh will talk to port 2222:

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

提交回复
热议问题