0

Today I copied some files from the shared folder (Host is a Win7) to my VM ( Guest is a CentOS7). I did this with root permissions. Then I copied th files to my apache location /var/www/html/test I am using putty, I only see the files in green and with the following permissions.

-rwxr-x--- 1 root root 175417 Mar 15 17:50

I need to change the file from executable files (Green) to normal files should i use chown or chmod and with which extensions? The files would be placed on a webside and should be downloadable.

to be clear i copied only a .zip file from Win7 to CentOS7

  • chmod 644 *.zip for readable (by everyone) or chmod a-x *.zip to only remove the exec bits (but that's not readable by everyone). – thrig Mar 15 '16 at 17:08
1

Being executable is a type of mode. chmod changes modes. chown changes owners (ie. the user that owns this file, which has the mode bits with the highest magnitude).

As such all you need to do is chmod a-x <path> to remove the executable bit for all ("a") users. If you just wanted to do it for your user, the owner ("o"), you can use o-x. instead.

|improve this answer|||||
  • dear chris thank you, the problem was solved by comment above. chmod 644 *.zip for readable (by everyone) or chmod a-x *.zip to only remove the exec bits (but that's not readable by everyone). – Mchoeti Mar 17 '16 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.