LinuxQuestions.org
Help answer threads with 0 replies.
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 05-14-2017, 12:04 PM   #1
chripy811
Member
 
Registered: Mar 2017
Posts: 31

Rep: Reputation: Disabled
Rsync permission denied using cron server to server over internet


I am able to get rsync working, from directory to directory on local computer,
and its even working from server to server if i input the command manually(it asks me for my password)


But using a cron over the internet from server to server, i am getting a permission denied from the cron, in the mail


I noticed when i make a cron and it runs at it's scheduled time, it doesn't ask me for a password and even if it did, i wouldn't be around when the cron runs.

is there a way i can put -pmypassword somewhere in my cron?


This is the command i am using in the cron:



rsync -av --delete -e ssh /mywebsitefiles/ root@89.123.123.123:/backup_of_mywebsitefiles/


where exactly do i put the password inside that cron commanad



thanks!

Last edited by chripy811; 05-14-2017 at 12:07 PM.
 
Old 05-14-2017, 12:24 PM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,576

Rep: Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341
at first you gave no exact information, so we can only guess. Probably you only mistyped something, or ????
But putting a password (of root) into crontab is not a good idea at all. You ought to configure passwordless login, use different account.
Probably the password contains something strange which may cause a syntax error.
I would try to write a shell script which can be invoked from a terminal and also works from crontab too.
Cron has no terminal and is not able to ask for any password.
 
Old 05-14-2017, 01:41 PM   #3
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,426
Blog Entries: 3

Rep: Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203
Quote:
Originally Posted by chripy811 View Post
where exactly do i put the password inside that cron commanad
You don't. You would invoke the SSH client with an option pointing it to the right key to use for authentication instead of a password.

Code:
rsync -av --delete -e 'ssh -i /home/chripy/.ssh/some_key_rsa' chripy@203.0.113.123:/backup_of_mywebsitefiles/
Again, you should turn off remote root access as soon as possible.
 
  


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
NFS Server permission denied markb81 Linux - Server 7 07-16-2012 11:11 AM
[SOLVED] Permission Denied by the server dramirez Red Hat 2 10-16-2011 04:33 PM
Server always gives permission denied binarybob0001 Linux - Networking 4 11-11-2007 10:43 PM
Tftp-server permission denied? Vid Linux - Software 6 01-28-2004 11:08 PM
reason given by server: permission denied scottsteibel Linux - Newbie 2 11-26-2003 03:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:48 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