Jump to content


[howto] automatically unlock keyring on login


12 replies to this topic

#1 pickwick

    Member

  • Members
  • 28 posts

Posted 15 February 2008 - 10:38 AM

This is for those of you who don't want to use wicd or wifi-radar...

Before you do this, BEWARE that this poses a security risk as it leaves your keyring password sitting in plaintext on your hard drive. It's probably best to change it to something other than your login password (see below) and be aware of which other passwords you add to your keyring.

Personally, that's a risk I'm willing to take since I don't value my wireless key that much - but it's something everyone has to decide for themselves.

That said, here's the HowTo:

Download the pam-keyring-tool binary (compiled for *buntu 7.10) from here.

Copy it to /usr/bin

cp ./pam-keyring-tool /usr/bin/
and make it executable

chmod +x pam-keyring-tool
Now create a file called unlock_keyring.sh, e.g. in $HOME/shellscripts

mousepad $HOME/shellscripts/unlock_keyring.sh
and put in the following

#!/bin/sh
echo "YOUR_PASSWORD" | /usr/bin/pam-keyring-tool -u -s
and make it executable

chmod +x $HOME/shellscripts/unlock_keyring.sh
Now add that shell script to you autostart list by going to Menu --> Settings --> Autostarted Applications


To change your keyring password, go to $HOME/.gnome2/keyrings and delete the file default.keyring and reboot. nm-applet should now ask you for your wireless key and after that, it should ask you to enter a new password for your default keyring.

If that doesn't work - e.g. if you don't have a file called default.keyring and/or you still need to enter your login password to unlock your keyring - then Xubuntu automatically sets your login password to be your keyring password and this is the only way I could figure out how to change it:

First, go to $HOME/.gnome2/keyrings and delete the file login.keyring. Now go to Menu --> System --> Users and Groups and temporarily set your login password to the one you want as your keyring password. Now reboot. Enter your wireless key and unlock your keyring with your new password. Now change your login password back to your old one via Menu --> etc. This will not change your keyring password.


Part of this solution was found here.
Black 4G | 2GB RAM | 8GB SDHC | eeeXubuntu | custom kernel 2.6.24-2-generic

G®eekbitches -- random collection of Linux HowTos

#2 wavydavey

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts

Posted 15 February 2008 - 12:17 PM

Brilliant! I'm now happy, that was the last of little niggles with eeexubuntu sorted out.

#3 eee35

    Member

  • Members
  • 23 posts

Posted 15 February 2008 - 07:31 PM

it works for me, should be in the wiki

#4 ashramrak

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts
  • LocationFrance

Posted 15 February 2008 - 07:38 PM

thank you man, i'll get this done asap

#5 NattyBohman

    Member

  • Members
  • 24 posts

Posted 07 March 2008 - 01:29 PM

Thanks. Can't wait to try this.

#6 jetfin

    Senior Member

  • Members
  • 218 posts
  • LocationUnited States Location:Croatia

Posted 07 March 2008 - 03:04 PM

Thanks much!

Works for me!
701 4g, black; 2gb kingston RAM; TS; usb hub; internal BT
900 (black) with 900a motherboard!

#7 teabagginz

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 08 March 2008 - 09:58 AM

it worked! thank you so much!
Galaxy Black 4G, 1GB RAM, 4GB SDHD, EeeXubuntu r3 + Compiz
Original wallpapers on my Flickr

#8 mediamind

    New member

  • Members
  • 5 posts

Posted 13 March 2008 - 01:15 AM

Dumb question:
When you say: "Now add that shell script to you autostart list by going to Menu --> Settings --> Autostarted Applications" which shell script specifically are you referring to?

Thanks much for your help!

#9 jetfin

    Senior Member

  • Members
  • 218 posts
  • LocationUnited States Location:Croatia

Posted 13 March 2008 - 03:47 AM

It's the file "unlock_keyring.sh" which you created.

-then the command you put in the new "autostarted applications" entry is the location of that file, such as:
/home/your_user_login_name/shellscripts/unlock_keyring.sh

-or just click on the icon next to the "command" text field and browse to the location you created the file at.


For some reason this didn't work for me after rebooting once (still got the annoying keyring prompt), but then after a second reboot it worked fine...
701 4g, black; 2gb kingston RAM; TS; usb hub; internal BT
900 (black) with 900a motherboard!

#10 mediamind

    New member

  • Members
  • 5 posts

Posted 16 March 2008 - 12:33 AM

Thanks for clarifying this jetfin. The autounlock worked on the very next reboot.

Edited by mediamind, 16 March 2008 - 12:34 AM.


#11 mediamind

    New member

  • Members
  • 5 posts

Posted 16 March 2008 - 01:31 AM

For any fellow newbies out there, I've translated pickwick's instructions into "easy mode." I'm sure there are more efficient ways to get this done but this is what worked for me so I thought I would share.

1. Download the pam-keyring-tool binary (compiled for *buntu 7.10) to your Desktop from here. http://launchpadlibr...am-keyring-tool

2. Change Directory to Desktop:

cd /home/YOUR_LOGIN_NAME/Desktop
(*remember to change YOUR_LOGIN_NAME to, well, your actual login name)

3. Copy pam-keyring-tool to /usr/bin

cp ./pam-keyring-tool /usr/bin/
4. Change directory to /usr/bin:

cd /usr/bin
5. And make the pam-keyring-tool "executable"

chmod +x pam-keyring-tool
6. Now create a new folder called "shellscripts" in /home/your_user_name:

sudo mkdir /home/YOUR_LOGIN_NAME/shellscripts
(again, remember to change YOUR_LOGIN_NAME)

7. Change directory to /home/YOUR_LOGIN_NAME/shellscripts:

cd /home/YOUR_LOGIN_NAME/shellscripts
(remember to change YOUR_LOGIN_NAME)

8. And create a file called unlock_keyring.sh

sudo mousepad unlock_keyring.sh
9. Paste in the following code and save and close.

#!/bin/sh
echo "YOUR_PASSWORD" | /usr/bin/pam-keyring-tool -u -s
(be sure to change YOUR_PASSWORD to your current password)

10. Now make the file executable

chmod +x unlock_keyring.sh
11. Lastly, add the shell script to you autostart list. You can do this by going to Menu --> Settings --> Autostarted Applications (click "+Add") and then click on the folder icon beside "Command" and navigate to your "unlock_keyring.sh" file (/home/YOUR_LOGIN_NAME/shellscripts)

12. Click OK and Reboot

Edited by mediamind, 16 March 2008 - 01:35 AM.


#12 th0r

    New member

  • Members
  • 9 posts

Posted 24 March 2008 - 12:17 AM

I have a problem :( When I execute command: cp ./pam-keyring-tool /usr/bin/

I get: cp: cannot create regular file `/usr/bin/pam-keyring-tool': Permission denied

What to do?

I am under root ...

#13 bukharin

    Member

  • Members
  • 11 posts

Posted 05 April 2008 - 11:32 AM

@th0r: are you sure you're root? If you're root, you shouldn't get that message. To check who you are, type:
whoami





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users