Bug 4520 - Add the ability to specify a password on the command line
Summary: Add the ability to specify a password on the command line
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.8
Hardware: All Linux
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2007-04-16 12:31 UTC by Michael Cargile
Modified: 2008-06-23 19:10 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Michael Cargile 2007-04-16 12:31:08 UTC
It would be very nice if there was an option to specify a password via the command line when connecting to an rsync repository, which would make integrating rsync into scripts much easier. Currently you need to specify a password file that holds the passwords or set the RSYNC_PASSWORD variable. It would be easier if one could just use options like:
  --password=somepassword --user=someuser
or being able to say:
  rsync://user:password@server:port/src/ destination
Comment 1 Matt McCutchen 2007-04-16 13:18:38 UTC
In bash, you can effectively provide the password in the command like this:

rsync --password-file=<(echo somepassword)

That translates into something like

rsync --password-file=/dev/fd/63 ,

where /dev/fd/63 is a pipe into which bash has loaded the text somepassword.

I think a --password option should not be added to rsync because of the easy alternative and because actually passing the password in a command-line argument often reveals it to other users on the system.
Comment 2 Matt McCutchen 2008-06-23 19:10:48 UTC
Use the environment variable or a pipe as in comment #1.