Skip to content

Commit 0dbc336

Browse files
committedMay 28, 2017
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 0dbc336

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎getssl

+3-2
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,11 @@ 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+
ssh "$servername" "chmod a+r $tofile"
519522
debug "userid $TOKEN_USER_ID"
520523
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}')
523524
debug "servername $servername"
524525
debug "file $tofile"
525526
# shellcheck disable=SC2029

0 commit comments

Comments
 (0)