Lee
Lee

Reputation: 20974

rsync remote site with bash

Hope you can advise I want to use rsync to carry out my FTP transactions but with bash.

How can I add the password to the rsync command.

I have for example.

rsync -r -update [email protected]:/public_html/ /var/www/domin.com/public_html

Hope you can advise.

Thank you in advance.

Upvotes: 0

Views: 3799

Answers (4)

Martin Beckett
Martin Beckett

Reputation: 96139

The correct answer would be to use ssh keys

This site provides a guide on creating and using ssh keys with rsync:

Upvotes: 1

Ogre Codes
Ogre Codes

Reputation: 19621

Here is a pretty good howto on setting up rsync with ssh using the authorized keys feature of ssh. http://blogs.oracle.com/jkini/entry/how_to_scp_scp_and

SSH is encrypted and the keys are much more secure than rsh authentication or using password files.

Upvotes: 0

Kyle Brandt
Kyle Brandt

Reputation: 28417

According to serverfault you can't, but there are some alternatives: https://serverfault.com/questions/24622/how-to-use-rsync-over-ftp

Upvotes: 0

Laurence Gonsalves
Laurence Gonsalves

Reputation: 143284

From man rsync:

Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync.

Upvotes: 1

Related Questions