Skip to content

Commit 4ac3ed4

Browse files
committed
chmod remote file copied by ssh to be all-readable
This is for the case where remote umask is not world-readable: something like 0027 or even 0077 (not even group-readable). Remote file copied to /.well-known/ should perhaps be world-readable. It really depends on web server configuration but we assume the most common configuration.
1 parent 7a9ffb5 commit 4ac3ed4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

getssl

+4-2
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,12 @@ copy_file_to_location() { # copies a file, using scp, sftp or ftp if required.
516516
error_exit "problem copying file to the server using scp.
517517
scp $from ${to:4}"
518518
fi
519+
servername=$(echo "$to" | awk -F":" '{print $2}')
520+
tofile=$(echo "$to" | awk -F":" '{print $3}')
521+
# shellcheck disable=SC2029
522+
ssh "$servername" "chmod a+r $tofile"
519523
debug "userid $TOKEN_USER_ID"
520524
if [[ "$cert" == "challenge token" ]] && [[ ! -z "$TOKEN_USER_ID" ]]; then
521-
servername=$(echo "$to" | awk -F":" '{print $2}')
522-
tofile=$(echo "$to" | awk -F":" '{print $3}')
523525
debug "servername $servername"
524526
debug "file $tofile"
525527
# shellcheck disable=SC2029

0 commit comments

Comments
 (0)