Do you need -e ssh for rsync?

Any time you need additional options to the ssh command outside of the user and host, then you need the -e flag. Perhaps the server you're connecting to has ssh listening on port 2222.

rsync -e 'ssh -p 2222' /source usr@host:/dest

An alternative to getting around this, there are 2 files you can use. /etc/ssh/ssh_config or ~/.ssh/config

The config file uses the same format as ssh_config. It's just able to be configured on a per user basis!


You would also need -e if you use a non-default private key location, i.e., specify the private key via -e 'ssh -i /path/to/private/key/file.pem'. For that matter, non-default listen ports for sshd, also. Basically, use -e if just using ssh user@host doesn't work.


You don't need -e ssh to use ssh. In fact, if you specify the target as user@host:/path/to/files, you're using ssh by default. It's left in a) for compatibility reasons and b) fringe cases where you might have a combination of rsyncd and ssh hosts.