Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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. – Martin Ueding 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
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. – Martin Ueding Jun 18 '12 at 9:09
@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? – Martin Ueding Jun 24 '12 at 15:59
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. – Martin Ueding 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. – Martin Ueding 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

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


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.