I have setup ssh  keys without a passphrase (Ubuntu) and copied them to my remote server (Centos6). I can login with ssh without a password successfully under my username.When I execute the following script in a terminal under my username  (not root) it works. When I execute it through cron under my user name it fails with response:Permission denied, please try again.Permission denied, please try again.Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).Here is  the script:#!/bin/bashexport PATH=/home/<username>/git/kodi-playercorefactory/bash-scripts:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/binrsync -rvzO  -e 'ssh -p 6135 -i /home/<username>/.ssh/id_rsa.pub' <username>@xx.xxx.xx.xx:<filename> <filename>Any help will be greatly appreciated
passphraseless access to rsync with ssh through cron fails
ssh;cron;rsync
The -i option of ssh is supposed to input the file name that contains the private key, not public key. But you have presumably given the file name containing the public key, given by the name /home/<username>/.ssh/id_rsa.pub.Assuming the private key is in /home/<username>/.ssh/id_rsa, the following should work:rsync -rvzO  -e 'ssh -p 6135 -i /home/<username>/.ssh/id_rsa' <username>@xx.xxx.xx.xx:<filename> <filename>