Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How to make an application like Gnote or Tomboy ask for a password when launching them from my user account.

share|improve this question
1  
Linux is meant to be used by a single user per account. If you just don't let anyone use your account, nobody should be able to read your notes. Or make a TrueCrypt image where you put your files into. –  queueoverflow Jun 17 '12 at 19:09
    
@queueoverflow my intention was find whether it is doable, if it is I am more than happy to use it. –  Siva Prasad Varma Jun 18 '12 at 3:54
1  
Nope, it is not that easy. It is just easy to set up a password for a whole account and for all the files for that account. –  queueoverflow Jun 18 '12 at 9:09
1  
@queueoverflow Can you add an answer? A negative answer is a valid answer if you believe its not possible. Thanks. –  fossfreedom Jun 18 '12 at 11:57
    
Did my answer help you? Did you find a solution? –  queueoverflow Jun 24 '12 at 15:59

2 Answers 2

up vote 0 down vote accepted

You can launch the application with gksudo to start it in super-user mode, e.g. to start Tomboy issue the command gksudo tomboy. You'll be presented with a graphical password prompt and after you enter correct password the application will be started in super-user(root) mode.

However, if you want to change this behaviour in the Application Menu then you have to change the Exec= line of the .desktop file corresponding to the application by adding gksudo after Exec= .i.e. Exec=gksudo tomboy. You can also do it using alacarte or Menu Editor, just find the right application menu-item, go to Properties and edit its Command field and add a gksudo before whatever is there.

share|improve this answer
    
Uhm, that is pretty useless, unless the data file is also owned by root. –  queueoverflow Jun 17 '12 at 19:09
    
@queueoverflow If the application is started in super-user mode, then the data files generated by it should inherit the same permission, isn't it? –  Samik Jun 17 '12 at 19:12
    
@Samik This does not work if you don't have sudo access on the system. I want to set a password different from my sudo password. –  Siva Prasad Varma Jun 18 '12 at 3:57
    
What you can do is to create another user, so that you have your account and the notes account. Then you can start it with su notes-user tomboy and have the files in /home/notes-user/. It should work, but it would be way easier to just not let anyone use your account in the first place. –  queueoverflow Jun 18 '12 at 9:10

There is no way to protect an application with a password like that.

The easy solution is to use Linux like it is meant to be: Let nobody use your user account. Your account password is the password to all your data.

If you still want to let everyone use your account, you could create a second account, let's call it notes and use that instead. Then you can call:

su notes
tomboy

This will then prompt for the notes's users password.

Or you use a tool like TrueCrypt, create an encrypted container and move your notes into there.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.