PDA

View Full Version : locking the screen



jbeck
08-28-2003, 02:19 AM
I accidently discovered the remarkable utility of Knoppix when taking Knoppix and a USB flash disk on keyfob on my current trip. So I am tremendously happy devil, stealing the souls of PCs wherever I find them and then returning them later intact, aside from the occasional swapfile.

But I have a question. Is there a way to lock the screen when I leave my KDE desktop. I read that knoppix has locked all passwords and I noticed that the "lock screen" off the main KDE menu is disabled accordingly.

Any ideas?

Thanks, Beck

AlanEzust
10-08-2004, 02:45 AM
My question is slightly related.

I'd like to write a script which automates the process of
doing an "apm -s " (sleep) followed by a lock screen.

How do I execute the KDE lock screen functionality from the command line? I am unable to determine what the name of that command is.

Cuddles
10-11-2004, 06:55 PM
Two posted questions, one response...

JBeck
I installed my Knoppix to the hard drive, and I have the "Lock Screen" enabled - the problem with not being able to run the Lock Screen, is that you dont have a password that will be used to "unlock" the screen. What you might try, is set a "user" password, and while you are at it, set a "root" password - as a test - and then see if the "Lock Screen" is enabled - you NEVER want to enable the Lock Screen without having a password, you will not have a way to disable the locked screen...

AlanEzust
I am using xscreensaver, not the KDE one, but, my command may be translated to yours, to fire-off my screensaver, the "X" one, I just run xscreensaver-command -activate, and if I wanted to lock the screen at the same time, I would add -lock to my command line. Not sure on this, I cant locate any information ( man or other ), but I think the program is called kscreensaver, I did a locate on it, and can only find the copyright docs for it, not the program. Best I can do for you...

Hope this helps, both of you,
Ms. Cuddles

CrashedAgain
10-12-2004, 03:11 AM
Two posted questions, one response...

JBeck
I installed my Knoppix to the hard drive, and I have the "Lock Screen" enabled - the problem with not being able to run the Lock Screen, is that you dont have a password that will be used to "unlock" the screen. What you might try, is set a "user" password, and while you are at it, set a "root" password - as a test - and then see if the "Lock Screen" is enabled - you NEVER want to enable the Lock Screen without having a password, you will not have a way to disable the locked screen...

AlanEzust
I am using xscreensaver, not the KDE one, but, my command may be translated to yours, to fire-off my screensaver, the "X" one, I just run xscreensaver-command -activate, and if I wanted to lock the screen at the same time, I would add -lock to my command line. Not sure on this, I cant locate any information ( man or other ), but I think the program is called kscreensaver, I did a locate on it, and can only find the copyright docs for it, not the program. Best I can do for you...

Hope this helps, both of you,
Ms. Cuddles
You should be able to set up auto locking of the screensaver from KDE control center, there is a check button for 'require a password to stop screen saver'. You will of course need passwords set before you activate it or else you will lock yourself out. You should be able to set passwords even when running from CD, 'passwd' or 'passwd knoppix' should set the user knoppix password & 'sudo passwd' will set root password. You will not notice any operational difference since user knoppix has full sudo privilidges with no password required. And of course if running from CD you will have to set this up each time you boot unless you save configs to a floppy disk.
Kscreensaver does not add any functionality, only just more screensavers...and half of these do not work, at least on my system.
You can find documentation on all KDE applications at http://docs.kde.org/. You can find descriptions of each package using kpackage. It has a 'search package' option to quickly get to the package you are interested in. Wish KDE Help Center had a similar search feature. Also wish KDE Help Center had a searchable terminogy dictionary included.

cleary
04-05-2005, 04:09 AM
An old thread I know, but I found the answer :)

You can lock your screen from the command line or from a script using the following DCOP command:

dcop kdesktop KScreensaverIface lock

From the Tips and tricks page in the KDE wiki
http://wiki.kdenews.org/tiki-print.php?page=Tips+and+Tricks


However, I'm having an issue:
When I was at uni we had some unix thin clients that had a screen lock function that prompted for a password everytime you locked the screen.
I want to get this functionality somehow - and figured using the command above in a little script that prompts for a password should be pretty easy.
I'm using 3.8 CeBit, and if I set a password for the user 'knoppix' then use the command above to initiate the lock on the screen, the screen goes blank, then I move the mouse and it pops out with no password request.
I've set the kscreensaver to prompt for a password after 45 seconds, but even if I wait that long it doesn't prompt for one.

What do I need to do to make it work?

Thanks :)

maxIT
04-23-2005, 03:13 PM
This is my way to lock the screen running livecd with kde:
-type knoppix 1 or 2 at boot for text mode.
-type passwd to set password.
-type kdm for login to kde.
Now you can lock the screen and to unlock you will be ask for password.

I'm still looking for a way to lock icewm which I play often with oldes/little-ram computers :cry:

antweb
10-10-2005, 05:53 PM
Two posted questions, one response...
JBeck
I installed my Knoppix to the hard drive, and I have the "Lock Screen" enabled - the problem with not being able to run the Lock Screen, is that you dont have a password that will be used to "unlock" the screen. What you might try, is set a "user" password, and while you are at it, set a "root" password - as a test - and then see if the "Lock Screen" is enabled - you NEVER want to enable the Lock Screen without having a password, you will not have a way to disable the locked screen...


There is a way to do it, its kinda tricky but i accidently locked the screen, and i tryed unlocking it but it wouldnt work, what you have to do is to press Ctrl + Alt + F2,F3 or F4 this will give you a root promt, from that you type

$ usermod -f "" knoppix
that should disable the disable on the account (enable the account)
then type

$ su - knoppix
that should log you on, then type

passwd
and change your passwrd nd voilla - it should change the password so u can unlock the screen - i had 2 do this last nite, and im not toaly sure if thats corect, if someone can tell me?

-ant

gpenguin
04-18-2006, 06:58 PM
Hello All,

I'm rather frustrated with this. I want to lock the screen after booting the live CD of Knoppix v4.0. However all suggestions I've seen do *not* work for me.

First, without setting any passwords, KDE session lock is *not* disabled...I _can_ select it. However, the mouse just goes away and when I move the move...I'm back as normal. So I set both the root and knoppix user passwords and try again...same thing.

Second, I see about launching xscreensaver...not even there...at least not in the $PATH.

Next, I tried the suggestion of booting into text-only mode (knoppix 2, specifically) setting the passwords and launching 'kdm'. I get the login screen, attempt 'knoppix' and it "cycles" back to the login screen. The password is accepted because if not, I get an invalid login attempt. This does attempt a login, fails to launch KDE, and goes bounces me back to the login screen.

*sigh* Ideas? I'm looking for the best security I can. I'd like to have the screen locked and *not* have anyone able to walk up and "ctl-alt-f1" to switch to a root console also if possible.

--David

dvryknopper
04-18-2006, 08:40 PM
See this topic about setting a password (http://www.knoppix.net/forum/viewtopic.php?t=11603&highlight=passwords) after this you should be able to lock the screen, give it a shot gpenguin.

gpenguin
04-18-2006, 09:46 PM
I can set passwords just fine. When I do a 'su -' after boot, I get the root prompt. Next I change the password for root, exit back to the knoppix user and when I attempt 'su -' again, I have to enter the password I changed. So changing passwords is not the problem...that works fine. The problem is KDE is not recognizing or not paying attention to the passwords.

Once the passwords are changed, locking the screen with KDE's menu option (Lock Session) does not actually lock it. Simply moving the mouse puts me right back to where I was. I'm not prompted for a password nor does it blank the screen (the screen saver session). I don't know if its relevant, but when I go to the KDE control panel, I'm give two screen saver options, blank and random...nothing more. This would indicate 'xscreensaver' is *not* installed...this could also be what is causing the lack of screen locking...don't know.

--david

Cuddles
04-19-2006, 05:52 PM
gpenguin,

I dont use the "kde" screen saver, it didnt have as many, or "better", or more likely, unique screensavers - ones that are not found within the "kde" screensaver system. As you have found out, kde does not even include that many "default" screensaver, the random & blank savers.

You either have to have KDE screensavers included with the Distro, on the LiveCD, or, you have to be able to "install" them, i.e. have a hard drive install, able to use klik, or Poor Mans, to be able to install with. (Even with xscreensaver)

I use xscreensaver, and I dont use the menu to change, configure, or start, the screensaver... I use scripts, and a desktop file to start them...

Ms. Cuddles
-=- Come do the Dark Side - We have penguins -=-

linuxchica
08-11-2006, 06:53 PM
Sorry for being such a tard: I figured this whole mess out but digging just a little deeper. So sorry.


antweb: I tried your solution. I booted the 5.0.1 DVD and locked the screen without setting a root password or a password for the user 'knoppix'. Your 'fix' mandates that one already knows the password.

My bigger question, I guess, is there has GOT to already be a defaul root password...right?

As un: knoppix, I can lock my screen and Knoppix requires a password for me to unlock it.

Cuddles
08-11-2006, 11:44 PM
My bigger question, I guess, is there has GOT to already be a defaul root password...right?

As un: knoppix, I can lock my screen and Knoppix requires a password for me to unlock it.

Aaaa, no... Knoppix DOES NOT already have a default password... for either a user account, or, root...

The whole thing about Knoppix is, it is intended as a LiveCD, and is not intended to be hard drive installed... Which, when you do those things, during the install, it does create a user, and a root, account, both with passwords that you enter... BUT, the LiveCD does not contain any passwords.

Think about it... If it did have a password, it would have to be "publicly" advertised, and if that were the case, you wouldnt likely change it, and thus, an attacker would only need to find out you are running Knoppix, and, attempt the default password. The way it stands now, you dont change it to something, personal, then you leave yourself open to attacks... It is already "publicly" advertised that Knoppix does NOT contain any passwords, so, most people, change it when they boot... But, then again, the LiveCD is read-only, and runs in memory only. So, not much someone can "infiltrate" on a CD boot? Right? (unless, of course, you mount up a few hard drives, as, say, read/write, and if you do, I would suggest that setting a root password is impairative)

Ms. Cuddles
-=- Come to the Dark Side - We have penguins -=-

jjmac
08-15-2006, 09:20 AM
Cuddles wrote:
>>
(unless, of course, you mount up a few hard drives, as, say, read/write, and if you do, I would suggest that setting a root password is impairative)
>>

Thats a good point, using the persistence facility, "knoppix home', can't really remember of hand but it will be in the docs cheatcode list, is a good idea. That is, a file on your hard drive that can be loaded at boot to provide a degree of personalisation. Your home dir and whatever you decide to include.


jm
----------------------------
http://counter.li.org
#313537