-1

i tried to lock pidgin application through the following code written on another thread

 jai@frank-Jai:~$ sudo chown root:root /usr/bin/pidgin

[sudo] password for jai: $$$$$$

jai@frank-Jai:~$ sudo chmod 700 /usr/bin/pidgin

jai@frank-Jai:~$ pidgin

 bash: /usr/bin/pidgin: Permission denied

jai@frank-Jai:~$ 

this has locked the app but now clicking on the app its not opening. it should ask for the password i suppose but thats not happening any way to unlock the app ? or i went wrong somewhere in locking?

Wilf
  • 30,194
  • 17
  • 108
  • 164
  • With what reason would you do such a drastic thing, and what was the post that advised you to? – Jacob Vlijm Dec 31 '14 at 07:01
  • Which post are you referring to? – Wilf Dec 31 '14 at 07:09
  • http://askubuntu.com/questions/335404/is-there-a-way-to-lock-a-specific-application-in-ubuntu-with-sudo-method this post is there no way to unlock? – Shubhankar Dimri Dec 31 '14 at 07:13
  • What are you trying to do exactly? – Wilf Dec 31 '14 at 07:17
  • 1
    Can't you find a "milder" solution here: http://askubuntu.com/questions/548568/how-to-block-specific-apps-from-opening-in-specific-accounts/548889#548889 or here: http://askubuntu.com/questions/445145/password-for-apps/445184#445184? You cannot run pidgin now because only root has permission run it. (and a password is only asked when you use gksu <application>. – Jacob Vlijm Dec 31 '14 at 07:19
  • my laptop will be accessed by my friends and i dont want them to read my messages thats why i am finding a way to lock an app and for opening it, it should ask for password – Shubhankar Dimri Dec 31 '14 at 07:20
  • 1
    There is this thing called Guest Session @ShubhiDimri – xangua Dec 31 '14 at 07:22
  • @JacobVlijm my bad luck i couldn't see it is there any way to revert the things? – Shubhankar Dimri Dec 31 '14 at 07:22
  • See the links in my comment above. The answer in your link is a bad one IMO, look at the comments to it. – Jacob Vlijm Dec 31 '14 at 07:22
  • 1
    this is what pidgin should be: -rwxr-xr-x 1 root root. resetting the permissions will do the job. (755 indeed, as suggested by @Wilf) – Jacob Vlijm Dec 31 '14 at 07:25

1 Answers1

0

It should already be owned by root so the chown command is not necessary - this:

sudo chown root:root /usr/bin/pidgin

Changes the ownership and group to be owned by root - it probably was owned by root in the first place, as could of be shown by ls -l /usr/bin/*, so was not necessary.

This command is what 'locks' the app:

sudo chmod 700 /usr/bin/pidgin

This change the permissions so the pidgin can only be read, written to, and executed by the owner (in the case, root - manual for chmod here). So to run it, you would have to run it as root with something like:

#sudo pidgin

Without the #. but DON'T RUN IT

However, that is a really bad idea (SO DON'T RUN IT), as any malicious code (there shouldn't be, but some things online can be evil) that is run could infect the system as root has access to everything - also as it run as root it can't use any of the configuration you made as your normal user, as root is a different user entirely.

To 'unlock' it so you can access it, run:

sudo chmod 755 /usr/bin/pidgin

This changes the permissions back.

To lock an app, try the answers @Jacob suggested above:

Can't you find a "milder" solution here: askubuntu.com/questions/548568/… or here: askubuntu.com/questions/445145/password-for-apps/445184#445184? You cannot run pidgin now because only root has permission run it. (and a password is only asked when you use gksu <application>

Also, with commands you find on the internet (most on this site are ok - check all of the answer, the other answers, and comments first though), it may be ideal (particularly when run with sudo as root) to look up info on the command with chmod --help, man chmod, or online, so you can find out what the command actually does.

Wilf
  • 30,194
  • 17
  • 108
  • 164
  • that just solved the problem but theres one more now ie every time i start ubuntu it ask for "unlock keyring" every time i have to enter password how this can be cured? – Shubhankar Dimri Dec 31 '14 at 07:38
  • What for? This probaly is something different, when you have setup and online account such as email etc, for some programs is stores the password in a keyring - try this question: http://askubuntu.com/q/495957/178596 . Did you run chmod on any other programs? – Wilf Dec 31 '14 at 07:44
  • thanks a lot everyting is fine now i deleted my online account and now its not asking for unlock keyring, thanks a lot – Shubhankar Dimri Dec 31 '14 at 07:53