I'm using Ubuntu and I'm here to know is there any way to modify access of a specific application so that it can only root has access to it?

Currently that application can be launched by general users but I want to make it so that only root can do this.


Make sure that the owner of the application is root and set the permissions such that only the owner can run it.

sudo chown root:root /path/to/application
sudo chmod 700 /path/to/application

If you look now at permissions with ls -l /path/to/application, you should see the following: -rwx------ root root, meaning that root can read, write and execute, and anyone else cannot even read that file.

| improve this answer | |
  • 1
    To find the path to the application, use which. For example, which cat. It will print the full path to the executable matching the name given. – user Sep 26 '12 at 12:01
  • 2
    @january The part which confuses me, though, is that I can apparently rm <file> and it works, even if I am not root. – Otto Dec 14 '17 at 13:33
  • 2
    Use sudo chmod 600 /path/to/application if you don't need execution permissions. – AxelWass Feb 14 '19 at 19:30
  • Note: this doesn't protect you against rm if the file is in a directory that is owned by the user. The user (without root) can still remove that file. – Zaid Gharaybeh Nov 9 at 16:05

Change the permissions of this applications as a root :

chmod 700 application-name
| improve this answer | |

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.