When using s3fs, files in the mount may have permissions that prevent you from viewing them. The files appear to have mode 0000 because some S3 clients don’t upload the correct metadata.

It is possible to chmod the files, but this may be time consuming and only lasts until the drive is unmounted.

The solution is to set the x-amz-meta-mode metadata.

Using boto, the following code will update the metadata without downloading and reuploading the file:

def update_metadata(bucket, key, mode):
    metadata = {'mode': mode}
    key.copy(bucket, key, metadata=metadata, preserve_acl=True)

The mode value is set by the decimal representation of the normal permissions bitmask:

update_metadata(bucket_name, key, '16895')  # 0100000111111111 -> d 777
update_metadata(bucket_name, key, '420')  # 110100100 -> 0644