I'm using the following command in root's crontab on Debian.
rsync -vqrlHEAXogDtzhi --log-file=${LOG} --progress --rsync-path="sudo /usr/bin/rsync" --exclude-from=$CONFIG_DIR/excludes -e "ssh -i /home/backups/.ssh/id_rsa" backups@${HOSTNAME}:/ ${BACKUP_DIR}
And I'm getting the following:
sudo: no tty present and no askpass program specified
I have tried adding -t to the ssh command and I get:
Pseudo-terminal will not be allocated because stdin is not a terminal.
I have tried adding -t -t to the ssh command and I get:
protocol version mismatch -- is your shell clean?
I have added a .hushlogin to the backups user on the remote box and confirmed that I can ssh as backups using a key to the remote box with nothing displayed (login is hushed). I still get these messages.
Note that I can ssh as backups to the remote box using a key successfully.
Note that my sudo does not have the -tt option.
Note that the following is set in source and destination's /etc/sudoers file:
backups ALL= NOPASSWD:/usr/bin/rsync
Note that my /etc/sudoers file does not have any reference to:
Defaults requiretty
Note that I won't echo my password in the command.
How can I skin this cat? 😐
Thanks
Best Answer
Sometimes you think too hard about things.
Rsync was not installed on the remote system.
/facepalm