rsync -> avoiding the password prompt for SSH

hi

I'd like to synchronize 2 freeBSD machines using rsync.
One machine is a server with rsync daemon and the second one is the client.
On the server I've created /etc/rsyncd.conf and rsyncd.secrets.
Howto use rsync with --password-file option at SSH command prompt on the client to avoid password question?

BTW Is it possible to do that without SSH public/private key exchange?

If I try from the clinet:
Code:
# rsync --password-file=/usr/local/etc/rsyncd.secrets /var/new/ root@192.168.1.10:/var/backup
The --password-file option may only be used when accessing an rsync daemon.
rsync error: syntax or usage error (code 1) at main.c(1239) [sender=3.0.4]
 
Just set up a public/private key without a password. Use that to authenticate.
 
  • Thanks
Reactions: ccc
SirDice said:
Just set up a public/private key without a password. Use that to authenticate.

I'd like to do that, if possible, without public/private key exchange.
 
ccc said:
just wondering, if it works and ssh configuration stay untouched.

You don't need to change the ssh configuration to make keys work.
 
  • Thanks
Reactions: ccc
ccc said:
I'd like to do that, if possible, without public/private key exchange.

It is possible, but it is unsecure as your password is exposed in a clear text format in shell or expect script itself. Google for sshpass utility. It does the same thing.
Code:
sshpass -p 'PassWord' ssh -o StrictHostKeyChecking=no username@server.example.com
OR
Code:
sshpass -p 'PassWord' rsync command
 
  • Thanks
Reactions: ccc
Back
Top