Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!nlm-mcs!sun1!randy From: randy@sun1.nlm.nih.gov (Rand Huntzinger) Newsgroups: comp.windows.x Subject: Re: How to lock a sun under X Message-ID: <6510@nlm-mcs.arpa> Date: 24 Mar 88 19:33:31 GMT References: <3757@mtgzz.UUCP> <22533@bbn.COM> Sender: nobody@nlm-mcs.arpa Reply-To: randy@sun1.NLM.NIH.GOV (Rand Huntzinger) Organization: National Library of Medicine, Bethesda, Md. Lines: 35 Keywords: Security Privacy Proprietary X_Window_System In article <22533@bbn.COM> milliken@bbn.com (Walter Milliken) writes: >I posted such a program for X10 to the xpert list a while back. >Here's the X11 version (apologies for posting source here, but it's >relatively short). > >The program locks the workstation and also performs as a screensaver. >To unlock the terminal, type your password, followed by a return. No >line editing is provided, but you can abort password entry by typing >return and starting over. There is a bit of a security problem with this program as given if you have pranksters around. I can sit on another host, set my DISPLAY environment variable to point to your machine, and if xhosts on your server lets me, I can lockup your screen remotely. If you don't know my password, you're sorta stuck. Of course, you can probably figure out I did it, unless I ran the program from Fred's terminal when he was in the bathroom. If you want to use it, you could make the following patch to require the program to be run from your workstation. That would help if you're the only guy with an account on your system. in main.c - replace the line: dsp = XOpenDisplay(NULL); with: dsp = XOpenDisplay("unix:0"); if(dsp == (Display *) NULL) { fprintf(stderr, "Can't connect to X server!\n"); exit(1); } That way only trusted friends can betray you.