S
S
Sergey2015-10-30 12:22:30
linux
Sergey, 2015-10-30 12:22:30

How to rsync with password for ssh without interactive?

It is necessary from one hosting, to which there is no access via ssh, copy to another access via ssh
Run the task with a script (because there is no access from the console to the first hosting)
here is my attempt, which does not work

rsync -avhz --password-file=passfile /var/www/site.ru [email protected]::/var/www/site.ru/

doesn't work like that.
ERROR: The remote path must start with a module name not a /
rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]

Tell me how can I do it?
(the sshkey option is not suitable, because there is no access to the console)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Saboteur, 2015-10-30
@karmis

"ERROR: The remote path must start with a module name not a /"
Can you read the error?
Remove the two colons in your second path. Or if you want to use exactly the rsync protocol with two colons, then specify the name of the module configured in rsync, and not just the path to the folder.

S
shaazz, 2015-10-30
@shaazz

Isn't it easier to do without passwords, based on certificates?

A
Andrey Korvyakov, 2015-10-30
@LNShadow

sshpass -p PASSWORD rsync ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question