I want to copy files using rsync over ssh, but a "Cannot execute command-line and remote command." is raised, meanwhile it works fine with scp.
Command : rsync -ravh folder XXX:folder
My ssh config is configured as follows :
Host XXX
Hostname YY
User user
RequestTTY yes
RemoteCommand bash --init-file ~/.bashrc
I noticed that by removing the RemoteCommand option, rsync does the job.
How could I manage to make rsync work while using my current ssh host config ?
Thanks in advance.
XXX.ssh) in ~/.ssh/config and use it in your rsync commandHost XXX XXX.ssh
Hostname YY
User user
Host XXX
RequestTTY yes
RemoteCommand bash --init-file ~/.bashrc
$ rsync -ravh folder XXX.ssh:folder
RemoteCommand directive with -e|--rsh rsync option$ rsync -ravh folder -e "ssh -o RemoteCommand=none" XXX:folder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With