LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to specify ssh password on Rsync for crontab? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-specify-ssh-password-on-rsync-for-crontab-4175526042/)

ASTRAPI 11-20-2014 07:49 PM

How to specify ssh password on Rsync for crontab?
 
Hi

I am on Centos and i am using this:

Code:

rsync -avh root@123.456.789.000:/backup/ /backup2/
and then i add the remote server password and all are ok ..

But how can i specify this password on a crontab command?

*I know is better to use ssh keys but i need for this case to do it this way.....

Thanks

evo2 11-20-2014 07:57 PM

Hi,
Quote:

Originally Posted by ASTRAPI (Post 5272666)
*I know is better to use ssh keys but i need for this case to do it this way.....

Really? If you can explain why you'll more likely be provided with a solution to your problem.

Evo2.

suicidaleggroll 11-20-2014 08:07 PM

Quote:

Originally Posted by ASTRAPI (Post 5272666)
*I know is better to use ssh keys but i need for this case to do it this way.....

I highly doubt that. Please explain why you think that's the case and we can go from there. I can't say that there's never a reason to script up an rsync/ssh/scp command with a plain-text password, but I can say that it's extremely rare. So, if you describe the situation we can help you better. If you do in fact need to provide a plain-text password in the script for everybody to see (which again is extremely rare, but possible), it is possible to do that, we just want to make sure this is the right solution for your problem, since it poses security problems out the wazoo.

ASTRAPI 11-20-2014 08:28 PM

There is no special reason why i need that ... i just prefer it now as it is more easy to do what i want once and then i don't know .....

So can anyone please help?

Thanks

evo2 11-20-2014 08:41 PM

Hi,
Quote:

Originally Posted by ASTRAPI (Post 5272679)
There is no special reason why i need that ... i just prefer it now as it is more easy to do what i want once and then i don't know .....

Doesn't seem so easy, otherwise you wouldn't need to ask here.
Quote:

Originally Posted by ASTRAPI (Post 5272679)
So can anyone please help?

Sure, see for example http://ramblings.narrabilis.com/using-rsync-with-ssh.

Evo2.

ASTRAPI 11-20-2014 08:46 PM

I know how to do it with ssh keys i just asking as i was not able to find a way to use simple password in my command :)

Ok thanks anyway....

As i can see there is no way to do what i ask so ok no problem :)


All times are GMT -5. The time now is 11:09 PM.