LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-20-2014, 08:49 PM   #1
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Rep: Reputation: 16
Question 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
 
Old 11-20-2014, 08:57 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,
Quote:
Originally Posted by ASTRAPI View Post
*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.
 
Old 11-20-2014, 09:07 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,353

Rep: Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989
Quote:
Originally Posted by ASTRAPI View Post
*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.
 
Old 11-20-2014, 09:28 PM   #4
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Original Poster
Rep: Reputation: 16
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
 
Old 11-20-2014, 09:41 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,
Quote:
Originally Posted by ASTRAPI View Post
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 View Post
So can anyone please help?
Sure, see for example http://ramblings.narrabilis.com/using-rsync-with-ssh.

Evo2.
 
Old 11-20-2014, 09:46 PM   #6
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Original Poster
Rep: Reputation: 16
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Rsync through ssh with public/private key keeps asking for password RagingRaven Linux - General 17 04-04-2015 09:32 AM
Rsync password asked even after generating key (while ssh works passwordless) frsechet Linux - Server 46 02-06-2015 06:55 PM
[SOLVED] Rsync .scp ssh password in single command sanjay87 Linux - Server 3 07-06-2012 02:24 AM
[SOLVED] rsync execution issue with crontab - Have given full path to rsync too!! Prabagaran Linux - Server 6 04-15-2011 02:39 AM
rsync over ssh - "wrong password"? yitzle Linux - Software 3 01-10-2008 01:34 PM


All times are GMT -5. The time now is 09:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration