Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the syntax and prerequisite for --password-file option in rsync?

Tags:

rsync

I want to store --password-file option that comes with rsync. I don't want to use ssh public_private key encryption. I have tried this command:

rsync -avz --progress --password-file=pass.txt source destination

This says:

The --password-file option may only be used when accessing an rsync daemon.

So, I tried using:

rsync -avz --progress --password-file=pass.txt source destination rsyncd --daemon

But this return various errors like unknown options. Is my sytanx correct? How do I setup rsync daemon in my Debian machine.

like image 536
Joyfulgrind Avatar asked Nov 22 '12 04:11

Joyfulgrind


People also ask

Does rsync need password?

Regardless of whether it is rsync protocol or SSH protocol, both can achieve password-free authentication login.

What is the rsync command?

Rsync is a command-line tool for copying files and directories between local and remote systems that should be in every Linux sysadmin's toolbox. Posted: August 12, 2020.


1 Answers

That is correct,

--password-file is only applicable when connecting to a rsync daemon.

You probably haven't set it in the daemon itself though, the password you set and the one you use during that call must match.
Edit /etc/rsyncd.secrets, and set the owner/group of that file to root:root with world reading permissions.

#/etc/rsyncd.secrets
root:YourSecretestPassword

To connect to a rsync daemon, use a double colon followed by the module name, and the file or folder to synchronize (instead of a colon when using SSH),

RSYNC_PASSWORD="YourSecretestPassword"; rsync -rtv user@remotehost::module/source/ destination/ 

NOTE:

  • this implies abdicating SSH encryption, though the password itself is not sent across the network in plain text, your data is ...
  • this is already insecure as is, never as the the same password as any of your users account.
  • For a better understanding of its inner workings (how to give specific IPs/processes the ability to upload to specified areas of the filesystem without the need for a user account): http://transamrit.net/docs/rsync/
like image 73
Joao Figueiredo Avatar answered Sep 19 '22 04:09

Joao Figueiredo