The reason for this error is that Linux wants to prompt for the sudo password on the remote host but doesn’t have a tty to show you one.

You can bypass this by not letting it ask for a password at all.

first I created a new backup user

sudo adduser backupuser

then add it to sudo group

sudo adduser backupuser sudo

then edit the sudoers file

sudo visudo

add the following line at the bottom

backupuser ALL=(ALL) NOPASSWD: ALL