2

I am hosting a php application on my CentOS 5 server. The application runs some commands via a ssh file called openmgr. For that I want to give a permission of -rwsr-xr-x to the file.

I tried chmod +x openmgr, but that gives -rwxr-xr-x permission only. How can I add rwsr for the file?

1
  • 9
    This is documented in man chmod and about two fantastillion documents searchable via Google. – Sven Dec 23 '14 at 8:05
5

The rws part denotes that, setuid permission for the file is set. It allows the users to run/execute the file with the privileges and permissions of it's owner.

In order to enable setuid permission on the file mentioned in the question, you should run:

chmod 4755 openmgr

Or

chmod u+s openmgr

3

You should get yourself familiar with man chmod (chmod(1) - change file mode bits).

  • hint: chmod 4755.

Your Answer

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