5,307 reputation
83072
bio website tombrossman.com
location Jersey, Channel Islands
age
visits member for 3 years, 7 months
seen Oct 9 at 5:40

2h
awarded  Notable Question
Oct
1
revised Where does shotwell store its config files?
FAQ page has moved, updated link
Sep
30
awarded  Explainer
Sep
29
awarded  Popular Question
Sep
15
accepted Why is this rsync + ssh cron job giving me 'Permission denied (publickey)' errors?
Sep
15
comment Why is this rsync + ssh cron job giving me 'Permission denied (publickey)' errors?
Thanks for the advice but I definitely do not have PermitRootLogin enabled and have no plans to change that. Best practice is to disable it, and ssh only as a normal user (add them to your 'sudoers' if necessary) and never as root.
Sep
15
comment Why is this rsync + ssh cron job giving me 'Permission denied (publickey)' errors?
@AlaaAli Based on your suggestions it is now working. I used the full env -i sh -c "rsync -lrstRO --delete --exclude 'lost+found' -e 'ssh -i /home/tom/.ssh/backups-only' /Backups/auto-daily-backups/./ backups-only@XX.XX.XX.XX:/backups/desktop/" command in the script called by cron. Also, number 5 was tried in both Terminal & the script - no luck. And auth.log (plus successful transfer of the backup files) confirm this now works as expected. If you post this as an answer I'll accept it (& bounty) so thanks very much! Still don't understand it all but happy to have it working now.
Sep
14
comment Why is this rsync + ssh cron job giving me 'Permission denied (publickey)' errors?
The commands each work individually, so I don't see how deleting ~/.ssh/known_hosts would change anything? And cron runs as my user 'tom' on the desktop, with the intention of logging in to the server as user 'backups-only' with that corresponding (passwordless) SSH key, which is in user tom's ~/.ssh.
Sep
11
comment Why is this rsync + ssh cron job giving me 'Permission denied (publickey)' errors?
cron.d/ and cron.daily/ have nothing unusual, and nothing that runs every minute. I tried the rsync ... -e 'ssh- i /Path/to/key (documented in step 5 of my original question) & it didn't help.
Sep
11
comment Why is this rsync + ssh cron job giving me 'Permission denied (publickey)' errors?
@Jan Thanks for the help so far, please see edit 2 above.
Sep
11
revised Why is this rsync + ssh cron job giving me 'Permission denied (publickey)' errors?
Added more detail from server access log
Sep
7
reviewed Reviewed Is it okay to sell linux distributions?
Sep
7
reviewed Reviewed “Syntax error: Unterminated quoted string”
Sep
7
reviewed No Action Needed RAID drive not detected by Lubuntu installer
Sep
7
reviewed No Action Needed Lan party network usage statistics
Sep
7
reviewed No Action Needed Ubuntu 14.04 on Macbook Air 6,1 nr_cpus=1
Sep
7
reviewed No Action Needed Btrfs subvolume @home not mounted kernel upgrade 3.17
Sep
7
reviewed No Action Needed Replacing Windows XP completely to Ubuntu (booting issues)
Sep
7
reviewed Looks OK Using MS Excel Keyboard shortcuts on Ubuntu
Sep
7
reviewed Approve suggested edit on darktable tag wiki excerpt