Link to home
Start Free TrialLog in
Avatar of qwertq
qwertq

asked on

rync w/ user and pass

how can I rsync to an external server using a username and password? can i do this all in the command without adding anything to the conf file?

thanks
ASKER CERTIFIED SOLUTION
Avatar of Jan Bacher
Jan Bacher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can use option '-e "rsh -l <remote user>'. In such case, you need to set up remote '.rhosts' file, to allow rlogin without providing password from your login and machine.

Suppose, machine you are running rsync is 'source.rsync.com', your local user is 'suser' and remote machine is 'target.rsync.com' and remote user is 'ruser'.

For remote user, you need to enter line in the ~ruser/.rhosts:

source.rsync.com suser

This will allow rlogin from suser without password.

Then run rsync with -e "rsh -l ruser" and other options you need.

Another way is providing password in local file and using --password-file=<FILENAME> option.
Probably there are others :)

Avatar of qwertq
qwertq

ASKER

there i no way to specify the password in the command with user? i was hoping not to have to edit any files like the conf.

whats the password file method?
If you use rsync over ssh and public key authentication, you do not need to provide a password if the SSH daemon on the destination server does not require it.

This also gives you protection of encrypted file transfers which rsync, by itself, does not.