10

I need to prevent my users from print screening the data that my program displays. Right now the idea I have is to make it a full screen program, where probably calling any other linux shortcuts or applications is blocked, and the print screen key is blocked. Is this approach correct? How would I go about getting this done?

Update: My users are confined to not running a virtual machine, and they do not have cameras. They are also using the GNOME desktop environment.

Update: The systems are mine. I have just granted them temporary access, So the systems, or their operating systems will not be tampered with. They cannot plug in any USB devices, and the users are mostly quite unknowledgeable about linux.

bdonlan
  • 224,562
  • 31
  • 268
  • 324
Khushman Patel
  • 1,066
  • 2
  • 13
  • 23
  • 2
    What if they take a pic of the screen with a cell phone camera? – Tom Studee Jul 23 '11 at 06:17
  • 1
    Or if they're running it in a vm? – Jason Goemaat Jul 23 '11 at 06:19
  • Or if they change the source code for the X server? – bdonlan Jul 23 '11 at 06:24
  • 7
    I honestly can not believe there are votes to close this question! Even if there is not a great answer for the person posting, it is still a legitimate and appropriate programming question suitable for Stack Overflow. There's a lot SO users getting alienated by "robo closures". – selbie Jul 23 '11 at 06:34
  • I agree. There really should be a requirement for someone to actually write a reason when trying to close for 'not a real question'. It's not "difficult to tell what is being asked here", nor is it " ambiguous, vague, incomplete, overly broad, or rhetorical" – bdonlan Jul 23 '11 at 06:39
  • 1
    It's a ridiculous question that, interpreted as stated, has no solution. If the only correct answer (which two people have given so far!) is "no, that's impossible", that seems a prime candidate for "not a real question". – C. A. McCann Jul 23 '11 at 06:42
  • I've put in a mod-flag for migration to superuser or serverfault. I'd vote to migrate, but four people have already jumped the gun with 'not a real question' closures before the OP had a chance to revise his question, and so it needs moderator attention to migrate it without closing. – bdonlan Jul 23 '11 at 07:00
  • 1
    Is it *really* so much to ask that people not post ill-formed questions that are missing critical pieces of information? Editing after the fact is all well and good, but a little forethought goes a long ways. – C. A. McCann Jul 23 '11 at 07:04
  • @camccann, that's fine, I just ask that you don't jump the gun. The OP had 3 close votes within 10 minutes of posting, and responded to comments and answers by adding needed information. Once the OP has 3 close votes, migration without either moderator intervention or a reopen vote is impossible. – bdonlan Jul 23 '11 at 07:10
  • 2
    I strongly suspect, that the real reason for the rapid-fire close votes isn't because the question is without answer. It's likely because of the great pride many Linux users have of their OS freedom and absence of proprietary restrictions - and this question *challenges* that idea. I'm surprised that no one has suggested that the freedom of Linux allows an IT adminstrator to compile his own distribution that disables all print screen capabilities. Not easy. But not impossible. Let's be reasonable here folks and give some hard questions a chance. – selbie Jul 23 '11 at 07:11
  • Meta thread opened: http://meta.stackexchange.com/questions/99537/how-to-restrain-improper-not-a-real-question-votes – bdonlan Jul 23 '11 at 07:14
  • 1
    @selbie: Don't be ridiculous. I would (and have) voted to close similar questions about other platforms. bdonlan makes a reasonable argument that closing was too hasty, which I somewhat agree with in hindsight, though I've seen many similarly ill-formed questions that are promptly abandoned and contribute no value to the site. You're inventing motivations that simply don't exist. – C. A. McCann Jul 23 '11 at 07:21
  • @Skkard, you may find it faster to simply repost your question on superuser at this point - reopening and migrating is likely to take hours, at least. If you do, leave a comment here so we know not to go through the process... – bdonlan Jul 23 '11 at 07:46
  • @bdonlan: Thank you for reopening the question. Has the migration process already been started? Or should I repost? – Khushman Patel Jul 23 '11 at 15:36
  • There aren't any votes for migration so far, probably in part because of the discussion on meta that bdonlan started. Since you probably don't really care about that, and you are likely to get better answers elsewhere, reposting may make sense. I'd suggest Server Fault, and expanding your question a bit to make it clear that you want to lock down a system you administer to prevent certain user actions. – C. A. McCann Jul 23 '11 at 16:16
  • The point is, the OP wants to prevent an X11 application from being screen grabbed. This is completely impossible, because of X11. Even if the system administrator did remove all screengrab programs, modified the X server and so on: The user could simply connect the application to a remote X server, possibly a Xvnc or Xvfb and get their screengrab that way. Or on a even lower level, implement some X proxy wiretapping all drawing commands, recreating the picture offline. The thing is: Computers are copy machines. It is impossible to copy protect digital data. Deal with it. – datenwolf Jul 30 '11 at 10:10
  • Check this link , https://stackoverflow.com/questions/19577536/how-to-disable-printscreen-by-gtk-in-linux – DAC84 Aug 26 '22 at 04:54

3 Answers3

5

My approach would be to not use GNOME or any other multitasking window manager, but simply have your application be the only client of the X server in question. (Maybe together with a special windowmanager which puts the window in full screen, and logs out when the program is closed.)

Setup your X server so it does not accept any other connections, and/or deny your users the ability to start any other programs on your computer (e.g. no shell login).

Paŭlo Ebermann
  • 73,284
  • 20
  • 146
  • 210
1

This is impossible. You cannot block 'screenshotting' from every level.

For example, even if you somehow disabled the key binding, blocked the gnome-screenshot utility, and so on, the user could still pipe the contents of the framebuffer device file to a file.

Delan Azabani
  • 79,602
  • 28
  • 170
  • 210
  • 1
    Only if the framebuffer's permissions are set up so they can do this, which is not necessarily the case. Not all users are root, and it's perfectly possible to run & use an X server as a different user to your applications. – Jules May 01 '14 at 11:11
-3

This is not possible. Users can write their own screen snapshot programs and get the screenshot at the end of the day even if you try to prevent them.

This is contradicting the philosophy behind free software and Linux. Users should be free doing anything with their programs without restrictions. How come you want to prevent users taking screenshots from a system they "own"? This does not make sense. They have right to do this.

ahmet alp balkan
  • 42,679
  • 38
  • 138
  • 214
  • 7
    Part of the freedom of free software is that you are free to use it to make a system that doesn't allow _anybody_ to do _anything_. The GPL doesn't say anything about only writing applications that allow people to do anything without restriction. – ptomato Jul 23 '11 at 14:43