diff --git a/simple_backup/simple_backup.py b/simple_backup/simple_backup.py index ebde737..ff28966 100755 --- a/simple_backup/simple_backup.py +++ b/simple_backup/simple_backup.py @@ -630,7 +630,7 @@ class Backup: # rsync splits the -e command itself, so quote the parts that may contain spaces if self.ssh_keyfile is not None: ssh = f'ssh -i {shlex.quote(self.ssh_keyfile)} -o StrictHostKeyChecking=accept-new' - elif self._password_auth and which('sshpass'): + elif self._password_auth and self.ssh_user is not None and which('sshpass'): ssh = f'sshpass -e ssh -l {shlex.quote(self.ssh_user)} -o StrictHostKeyChecking=accept-new' else: ssh = 'ssh -o StrictHostKeyChecking=accept-new'