Lock an application in Linux
By Sweta Panigrahi | 01-03-2018 11:03 AM | 836 | 1
* I am using Fedora 24 here, but it can be done in any Red Hat or Debian based OS.
We are going to change '.desktop' file of the particular application in order to lock it. Every application has its own '.desktop'f ile.
In GNOME, an application gets registered into the desktop's menu through a desktop entry, which is a text file with .desktop extension. This desktop file contains a listing of the configurations for your application.
.Desktop file is located in directory: /usr/share/applications
We will change the permission using the same file.
How to do that?
1. Open the terminal and go to the directory mentioned above.
$ cd /usr/share/applications
|List of my .desktop files|
2. Select the application that you want to lock. For example, I will lock Firefox.
Open firefox.desktop file using any text editor. As I am in love with vim, I will use the same.
$ sudo firefox.desktop
|Text file 'firefox.desktop'|
3. We are going to change Exec=firefox %u to Exec=gksudo -k -u root firefox %u
Here we are changing the file permission when executed.
So search Exec=firefox in the text file.
To search in vim, press ':' followed my a '/' and the characters that you want to search.
|searching :/Exec=firefox %u|
Cheers, we are done!