diff --git a/templates/real-from-dwd-ana/prepare_date_local.sh b/templates/real-from-dwd-ana/prepare_date_local.sh
index 7e075d975dba0aa1e931df26e6b1ae40092bb1a6..86f53807990585934e91c23b2f75ae366010d416 100644
--- a/templates/real-from-dwd-ana/prepare_date_local.sh
+++ b/templates/real-from-dwd-ana/prepare_date_local.sh
@@ -51,7 +51,7 @@ if [ "${IS_LOCAL}" == "True" ]; then
     rsync -v "${AN_SOURCE}" "${HPCUSER}@${HPCHOST}":"${COMMON_DATE_FOLDER}/${AN_FILE}"
 
     # Change permissions to read only.
-    ssh "${HPCUSER}@${HPCHOST}" chmod 440 ./*
+    ssh "${HPCUSER}@${HPCHOST}" chmod 440 "${COMMON_DATE_FOLDER}/${AN_FILE}/*"
   else
     # Create member folder and go there
     mkdir -p ${COMMON_DATE_FOLDER}
diff --git a/templates/real-from-dwd-ana/prepare_date_remote.sh b/templates/real-from-dwd-ana/prepare_date_remote.sh
index a1f41d033ff61659675a679e1f054a642f9b7740..a503ae865797c5ff72a336a47f9486004b840f2d 100644
--- a/templates/real-from-dwd-ana/prepare_date_remote.sh
+++ b/templates/real-from-dwd-ana/prepare_date_remote.sh
@@ -50,7 +50,7 @@ if [ "${IS_LOCAL}" == "0" ]; then
     rsync -v "${AN_SOURCE}" "${HPCUSER}@${HPCHOST}":"${COMMON_DATE_FOLDER}/${AN_FILE}"
 
     # Change permissions to read only.
-    ssh "${HPCUSER}@${HPCHOST}" chmod 440 ./*
+    ssh "${HPCUSER}@${HPCHOST}" chmod 440 "${COMMON_DATE_FOLDER}/${AN_FILE}/*"
   else
     # Create member folder and go there
     mkdir -p ${COMMON_DATE_FOLDER}