diff --git a/handlers/rsync.in b/handlers/rsync.in
index 8f638d7f41f1bc09e3311ad7e5a7eea25ee337ed..be97773f0b18b5cb0c4b50cbccdb56cd3d8a50d3 100644
--- a/handlers/rsync.in
+++ b/handlers/rsync.in
@@ -279,7 +279,7 @@ function eval_config {
     nice=""
   fi
 
-  ssh_cmd="ssh -T -o PasswordAuthentication=no $host -p $port -l $user -i $id_file"
+  ssh_cmd="ssh -T -o PasswordAuthentication=no -o Hostname=$host -p $port -l $user -i $id_file"
 
   if [ "$from" == "remote" ] || [ "$dest" == "remote" ]; then
     if [ "$testconnect" == "yes" ] && [ "$protocol" == "ssh" ]; then
@@ -913,7 +913,7 @@ function set_rsync_options {
       else
         debug RSYNC_RSH=\"$ssh_cmd\"
         echo RSYNC_RSH=\"$ssh_cmd\" >> $log
-        RSYNC_RSH="$ssh_cmd"
+        export RSYNC_RSH="$ssh_cmd"
       fi
     fi