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

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

    A bit offtopic but might help someone. If you need to pass password and port I suggest using sshpass package. Command line command would look like this: sshpass -p "password" rsync -avzh -e 'ssh -p PORT312' root@192.xx.xxx.xxx:/dir_on_host/

提交回复
热议问题