Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I know there's a lot of dupes around the keyring, but I did my research, and I think my question is unique:

Is it possible to

1) lock the screen during autologin-boot (to maintain security, but have the comfortable autologin start the desktop while you fetch coffee)

2) then, when arriving at the computer, you unlock the screensaver with your password, and at the same time (by this process) the keyring gets unlocked? (to save yourself having to enter your password twice in a row, once for the screensaver, once for the keyring)

This approach would have the benefit that Alice could enjoy automatic startup without sacrificing too much security (i.e. no unlocked autologin), and save her from entering her password multiple times (by combining screen and keyring unlock - an OK approach security-wise I think). It would effectively, from a user perspective, behave like a conventional startup&login process, only that your system is fully ready once you enter the password (under the conditions of one-user systems and unattended boot up - not untypical for laptop users I maintain).

Information found so far:

ad 1): I found this brainstorm, but on adding his code to .profile, my screensaver unlock prompt just endlessly blinks on and off, so this is probably an obsolete process. Any other options or corrections to the linked one?

[edit]: OK, this part worked by adding gnome-screensaver-command -al to the startup applications. Sadly, on unlock the keyring unlock dialog greets me, so #2 is still outstanding.

ad 2): I couldn't find any hints as to if this is possible.

[edit2]: It seems there is currently no way to do this, except by disabling the keyring password.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

With unsecure keyring

You could add gnome-screensaver-command -a at Startup Applications:

1) Alt + F2 then paste gnome-session-properties and click Enter

2) Click "Add" and paste the command above.

enter image description here

Regards.

With secure keyring

(If you don't want to empty your keyring password)

After the steps above, you make a script that will run at startup and will check if the screen are locked or not. If it is unlocked, it will run a python script to unlock keyring.

Make this perl script and put it to run at "Startup Applications"

  
#!/usr/bin/perl
my $cmd = "dbus-monitor --session \"type='signal',interface='org.gnome.ScreenSaver',member='ActiveChanged'\"";

open (IN, "$cmd |");

while () {
    if (m/^\s+boolean false/) {
        exec('/usr/bin/unlock-keyring');
    } 
}

Make this python script, make it executable and move it to /usr/bin/unlock-keyring

  
#!/usr/bin/env python

import gnomekeyring
import getpass

gnomekeyring.unlock_sync(None, getpass.getpass('Password:your.password.goes.here'));

References: 1, 2, 3.

share|improve this answer
    
thank you. this solved point 1). Any ideas about 2)? –  Christoph Aug 11 '11 at 17:01
    
    
I'm aware of that (and, sadly, the loss-of-security implications). On second thought, maybe those are not relevant anymore due to the locking screen, and I could empty-password the keyring....hm... –  Christoph Aug 11 '11 at 17:39
    
OK, I disabled the keyring password for now, since the automatically locked screen should provide some security. Would still like a better solution, though. –  Christoph Aug 17 '11 at 19:48
    
I've updated the answer just to make you happy ;-) –  desgua Aug 17 '11 at 20:57
show 2 more comments

I think a simple bash script like this

#!/bin/bash

gnome-screensaver-command --lock

added to your startup programs list should work.

Hope this helps

share|improve this answer
    
thank you. this solved point 1). Any ideas about 2)? –  Christoph Aug 11 '11 at 17:01
add comment

Your Answer

 
discard

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.