I have a shared directory from SAN, whenever I create a folder or file inside that directory, it already has permissions; for directory we have "drwxrwxrwx" permission and for files we have "rwxrwSrwx" Now I am having trouble reading these files from my application and want to change their permission but they won't change. I used 755, -R 755, a-s, g-s to no effect.

Appreciate your help

Regards, Ali

  • Can you give the output of ls -l for the file? – Kheshav Sewnundun Dec 4 '15 at 6:32

You have misidentified the problem. man ls says:

S If in <owner permissions>, the file is not executable and set- user-ID mode is set. If in <group permissions>, the file is not executable and set-group-ID mode is set.

So, rwxrwSrwx includes rwxrw-rwx.

Do mount, check the options and man 8 mount.

Also, check the permissions of the parent directories:

ls -ld . .. ../.. ../../..   

Recheck your code for bugs.

Check the logs on the server.

Check your umask locally and on the server.


  • I think you are right, because I can touch a file in directory, I can even delete files. But I have an application (installed on linux) which needs to open these files for reading and that application cannot read these files from this directory, I copied some files to another directory and my application can read it just fine. I check my mount and these files are mounted with CIFS protocol, could this be a problem? following is the whole syntax we used in fstab: "<directory> <directory> cifs userame=abc,password=abc,sec=ntlmssp,uid=8005,gid=805,domain=abc.com.pk – Ali Miher Dec 7 '15 at 4:59
  • and the user with uid=8005 is the owner of the application i want to run – Ali Miher Dec 7 '15 at 5:00

The S in the group permission bit means that setuid bit is turned on the file.

Basically you can remove it with chmod g-s filename

It might be you need to launch with sudo command:

sudo chmod g-s filename

[Proof of concept]

-rwxrwSrwx. 1 apache k.sewnundun 24 Dec 4 10:30 a.sh

sudo chmod g-s a.sh

-rwxrw-rwx. 1 apache k.sewnundun 24 Dec 4 10:30 a.sh

  • I tried, my nomral user is not in sudo group so i tried with root and still not change :-( – Ali Miher Dec 7 '15 at 4:53

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.