Know when someone accesses your files in GNOME

By | July 25, 2009

Say you want to write a small shell script that locks up your GNOME desktop at specific intervals. What command would you use?
In this case, your best bet would be

gnome-screensaver-command lock

This has the same effect as you pushing the Lock Screen button in GNOME. You can forge a small shellscript and use this to lock up your desktop when someone launches an application. Or append the line at the end of the Brasero launch command, using the icon’s command line field, so that whenever someone tries to burn something without your knowledge, the screen will lock up immediately afterwards. For example:

brasero && gnome-screensaver-command –lock

Put this in a new text file, make it executable and replace it’s icon with Brasero’s. Next time someone launches Brasero, after the application is closed, the screen will automatically lock up and you’ll know it was accessed by someone.

16 thoughts on “Know when someone accesses your files in GNOME

  1. foobar

    First, what about the title “Know when someone accesses your files in GNOME”? Do you really suggest to replace all files with shell scripts locking the screen after execution …? Alternatively, what is gained if the “intruder” does not open Brasero, but some other application, possibly from the program menu? This is a rather worthless “tip”.

    Second, and most important, why not locking the screen in the first place? Then you just have to look around in /var/log/auth.log.

    Third, and as a side note, you should disable WordPress’ auto correction (or do some character masking–I don’t know WordPress enough) so that two successive hyphens don’t become one dash.

    Reply
  2. T4L Post author

    First, the title is perfect for this tip. And no, I don’t suggest replacing EVERY link of EVERY file with a shellscript. Just the one or two you want to know people have accessed and don’t have the time to check the logs.
    So it’s not a “worthless” tip. 🙂

    Secondly, yes – you can lock the screen whenever you want. But what if you have a nosy co-worker? Do you want to lock your screen whenever you go out for a smoke just so he won’t be able to access it? What if you have an important document you don’t want anyone to see? And just that. Or an application you know a certain person would give their lives to check out without your knowledge and you don’t want them to. Wouldn’t you like to know if they did it or not? Would it be better to ask yourself “did he see my Anime Pr0n game I launch thorugh a Wine shortcut, or not?”.
    By making the screensaver lock the screen when something is clicked, you’ll know when a person did something on your computer while you were away, since YOU were not the one who actually locked the screen. Permanently locking your screen makes people curious.

    Thirdly, I spoke with the creator of the present WordPress theme just this morning and we’re trying to fix the hypens problems.

    Reply
  3. Dan D

    Worthless tip. Wow. What a waste of my time reading it. Catchy title, then just a bunch of shit. Complete shit.

    Reply
  4. Pingback: HowtoMatrix » Know when someone accesses your files in GNOME

  5. foobar

    T4L, thanks for the reply.

    I don’t suggest replacing EVERY link of EVERY file with a shellscript. Just the one or two you want to know people have accessed

    Well, then the title should be something like “Honeypotting your unprotected workplace”. 😉

    But I still think it’s a worthless tip.

    Do you want to lock your screen whenever you go out for a smoke just so he won’t be able to access it?

    Sure. That’s what locking is for, after all. Additionally, my menu bar is on the top of the screen (auto-hiding) while my “desktop” is just a dead screenshot from a standard Windows-2000-style desktop with some icons. Nothing works, kind of BSOD. 😉

    Thirdly, I spoke with the creator of the present WordPress theme just this morning and we’re trying to fix the hypens problems.

    Great. While auto correction is great for easily inserting special characters, it’s bad for code and options.

    Reply
  6. Smithy

    “the screen will lock up immediately afterwards” – isn’t this a case of closing the gate after the horse has bolted?

    If you are worried about people physically accessing your machine, try vlock instead*. It can lock and keep people out of the whole desktop, including virtual consoles (i.e. Ctrl-ALt F2/3 etc…). Bind it to a key combo with xbindkeys and use it with any desktop.

    (* Or save energy/money by turning it off if you are away for a while)

    Reply
  7. foobar

    Hey, now I see that you have no useful styles for blockquote elements implemented. Maybe you could fix this, too …

    Reply
  8. Anonymous

    “Do you want to lock your screen whenever you go out for a smoke just so he won’t be able to access it?” Of course, that is how security works. Do you lock your car when you go to the shop to get your pack of smokes?

    “you’ll know when a person did something on your computer while you were away” – but you won’t know who did it… Unless you are going to fingerprint your machine and everyone else! Lol.

    Reply
  9. jackd

    Honestly, this is as dumb an idea I’ve seen.

    And I agree with the earlier posters: the title really is inappropriate.

    Reply
  10. T4L Post author

    Owned author fixed formatting issues with the site. :))

    Reply
  11. Damocles

    I was expecting this article to be related to the Nautilus File Manager in GNOME. I know Nautilus can poll (or is otherwise informed) of changes to the cwd of the file browser window, and auto-update, and I was expecting some sort of script or plugin that would have Nautilus write a log file or otherwise alert the user when the access timestamp of a file in a monitored directory has changed and was not done so by any application spawned by the current X session (meaning probably not the user).

    Instead I got this piece of crap about the wonders of running two commands from the same shortcut.

    Reply
  12. 2me-T3ch

    There are much better ways to accomplish this … I give you credit for wanting to share with the community but there are much, much better ways to accomplish this.

    As far as security goes … locking the screen after the person viewed your files really is an example of shutting the barn door after the horse escaped. Further more … won’t this lock the screen each time you try and access the icon? Or are you suggesting that you put a fake icon on your desktop to entice someone to click on it … I really don’t see the point when you can just lock the screen yourself when you get up from your desk … it’s not a hassle really and much more secure than locking the screen after the culprit has already done the damage.

    Now as far as actually securing your stuff … I would recommend that you encrypt the file (data) that you are trying to protect and then password protect the encrypted file. This way you can foolishly leave your desktop unlocked and still have your files protected. You could add an IDS that would log anytime someone tried to access the file and failed (which would happen since they don’t have your key) but the log would record that it was your user id that attempted to access the file … not very useful.

    Maybe instead of appending the desktop screen lock onto your file you could write a script that would automatically turn on your webcam and append that to your script … it would be a lot more clever to have visual evidence of who was at your desktop when the file was accessed.

    Reply
  13. DracoTrapnet

    It is policy to lock your desktop at work, I also do it at home if someone is there. I have a lot of photos and video I dont want lost by someone that doesnt know linux monkeying around with my system. I set a keyboard shortcut to lock screen, control alt l (Since gnome is too stupid to use winkey+l that windows does and alt control delete doesnt have lock available)

    I lock screen religiously. It is none of anyone’s buisness what I have on my machines.

    If you want to entrap someone, use deskscribe from the repositories. If you want to protect some files, create another user and use su -l to use those files. May require xhost + or updating some keys if you plan to run windowed applications.

    Reply
  14. Anonymous

    thats is so retarted its almost funny.
    if this is meant to be a joke, change post title to “linux hacks”
    actually kind of sad….

    Reply

Leave a Reply to foobar Cancel reply

Your email address will not be published. Required fields are marked *