I'm wondering if it is possible to use gnome-keyring-daemon without X. Normally it will present a graphical prompt in order to acquire a password for the keyring; is there a way around this? I'd like to be able to use ubuntu one without having to start a graphical session and type in my password.

link|improve this question

48% accept rate
feedback

2 Answers

up vote 4 down vote accepted

You can use pam_gnome_keyring.so to start and unlock the daemon. GDM already does this; for login, you must configure it manually.

Add these lines to /etc/pam.d/login:

auth     optional  pam_gnome_keyring.so
session  optional  pam_gnome_keyring.so auto_start

If you log in without a password (SSH with Kerberos or public keys), this may work: (I haven't tested it)

echo -n "mypassword" | gnome-keyring-daemon --login

(You still need the daemon to be running - either started via PAM or with --daemonize.)

link|improve this answer
Second case is the case in my case. That (undocumented?) --login option is pretty useful, though I sure wouldn't want to keep my unhashed password in a script or put it on a command line. reading in unechoed mode from within a (non-shell-language) script that then passes that input to the spawned daemon would probably be a good way to do this. I should only have to start this process once per boot, so it makes sense to type in the password; I just need to be able to do it at the command line instead of via the GTK dialog. – intuited May 14 '10 at 21:25
err.. nevermind, it's documented by gnome-keyring-daemon --help. I just checked the manpage and /usr/share/doc. – intuited May 14 '10 at 22:32
1  
@intuited: Well, then do something like this: read -rsp "Password: " pass; echo -n "$pass" | gnome-keyring-daemon --login in a script. – grawity May 15 '10 at 10:55
Actually yeah, that would work; I was forgetting that echo was a builtin. – intuited May 15 '10 at 18:52
feedback

First, what you really want to be doing is running Ubuntu One strictly from command-line. Take a look through the Ubuntu One FAQ. The FAQ says it's not presently possible, but there are some CLI tools like u1sdtool and u1sync. There's also a set of FAQs on Ubuntu One at Launchpad; the content may be the same as the earlier wiki.ubuntu.com link.

Regarding your actual question about gnome-keyring-daemon, the FAQ suggests (1) setting auto-login and (2) synchronizing your keyring password with your login password. This would (in theory) avoid the password prompt, but it would require at least a basic X-session to be running.

There's an Ubuntu One bug/wishlist on Launchpad that requests making it easier to handle headless systems. Apparently building from source is recommended for a lightweight install (to avoid the need for all the GUI libraries and such). This comment is old, but particularly interesting:

The problem is that we use python-gnomekeyring. For us to support headless, we'll have to switch to python-keyring, and handle storing tokens somewhere other than gnome-keyring on headless displays. However, none of this is going to happen for the Karmic packaging as it is frozen, and this change wouldn't be acceptable in an SRU.

For Lucid, we should have a more robust authenticaton service, which should allow us to support headless displays better.

I can't tell if this "more robust authentication service" was actually put in place for Lucid; based on the package dependencies, it seems the Ubuntu One client is still dependent on python-gnomekeyring.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.