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

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

    when you need to send files through a specific SSH port:

    rsync -azP -e "ssh -p PORT_NUMBER" source destination
    

    example

    rsync -azP -e "ssh -p 2121" /path/to/files/source user@remoteip:/path/to/files/destination
    

提交回复
热议问题