Thursday 27 August 2015

Lock any application in Linux

Some times we need to lock some applications for security purposes. In this article we will learn how to lock any application in Linux (It is support for both Debian and Redhat based systems)

Our Objective

     We are using .desktop file to lock any application in Linux. All applications has it's own .desktop file. Commonly, .desktop file is used to define various performance of application, when it run in X based system (Commonly GUI). We can modify application's performance via it's .desktop file. .desktop file is also called as configuration file for an application.

Where .desktop file is located?

  All apllications .desktop file is located in /usr/share/applications directory.

 What we need?

  1. Terminal
  2. Any text editor

How to do?

  • Open your terminal window, then go to /usr/share/applications directory.
     cd /usr/share/applications  
    
  •   I have following applications .desktop files. You can view it by typing ls command

/usr/share/applications









  • For an example, i want to lock firefox applications. So that the application will can ask password (root passord), whenever it launced.
  •  Open firefox.desktop file via any text editor. Where now am using nano text editor
     sudo nano /usr/share/applicatios/firefox.desktop  
       Find Exec=firefox and change it in to Exec=gksudo -k -u root firefox %u. Now save and exit. 
      Now launch firefox, it will ask password to run the application. 

    No comments:

    Post a Comment