Red Hat Bugzilla – Bug 367611
login(1) should start a D-Bus session bus and ssh-agent
Last modified: 2010-09-08 06:07:03 EDT
Description of problem:
The ssh-agent and a D-Bus session bus aren't intrinsically tied to X sessions,
but we currently wait and let xinit() do the work of starting them, so they're
only available by default while the user is running 'startx'.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Log in at the console.
2. Run "ssh-add -l".
3. Run "dbus-send --session --print-reply=s --dest=org.freedesktop.DBus /
"Could not open a connection to your authentication agent."
"Failed to open connection to session message bus: dbus-launch failed to
autolaunch D-Bus session: Autolaunch error: X11 initialization failed."
"The agent has no identities."
A large pile of introspection data.
Created attachment 248641 [details]
patch to make login start up ssh-agent and a session bus
Comment on attachment 248641 [details]
patch to make login start up ssh-agent and a session bus
Hmm, actually the third arguments to AC_ARG_ENABLE are wrong.
Sorry, but this is ugly hack. I really don't want to hardcode any command line
to the login(8).
Cannot we try to found any better solution? PAM (pam_exec), /etc/profile, HAL or
Hmm, the pam_exec is probably useless if you need to set SSH_AUTH_SOCK and
What about to:
- init by /etc/profile.d/dbus-session and /etc/profile.d/ssh-agent
and write PIDs to $HOME/.dbus.<tty> and $HOME/.ssh-agent.<tty>
- deinit by pam_exec /usr/bin/dbus-session-cleanup and
I think it's much better.
Why is ssh-agent / DBus necessary for non-X sessions?
If it is necessary for console sessions, won't it be necessary for ssh sessions
In that case, we could use /bin/fedora-session-bash as a default login shell
(and fedora-session-tcsh for tcsh, etc.). This binary would, when launched as a
login shell, launch all the necessary daemons, run the specified "real" login
shell, an kill the daemons after the shell exits.
exec -l $SHELL -c "$SSH_AGENT $DBUS_LAUNCH /etc/X11/xinit/Xclients"
by a simple
exec -l $SHELL
and let $SHELL take care of all the necessary daemons.
If fedora-session-bash were run as a non-login shell, it would simply exec bash.
This is cleaner than patching each getty/?dm/whatever separately; as an added
benefit, it would unify the X and non-X launch path.
(In reply to comment #3)
> Sorry, but this is ugly hack. I really don't want to hardcode any command line
> to the login(8).
Yeah, probably. There's the big problem that it's sending a signal to a process
from the login process while it's running as root, so problems will arise if the
user causes either of them to exit before the user's session ends. Please don't
use the patch.
> Cannot we try to found any better solution? PAM (pam_exec), /etc/profile, HAL or
Sure. I'm not wedded to the implementation. The scripted methods can get
pretty ugly, but you're right, they're safer. I'm not sure what HAL would do here.
(In reply to comment #5)
> Why is ssh-agent / DBus necessary for non-X sessions?
The use of the agent has no relationship with X -- it can be started from a
shell prompt and used just as easily. The X session script was just a simple
means to make it available for the user's session. I'm not aware of anything
using a D-Bus session bus that doesn't run inside of an X session, but there's
no technical issue that prevents it, either.
> If it is necessary for console sessions, won't it be necessary for ssh sessions
> as well?
OpenSSH already forwards agent connections (that's disabled by default for
security reasons), but it currently doesn't forward D-Bus session bus
connections. That'd probably be useful, though.
> In that case, we could use /bin/fedora-session-bash as a default login shell
> (and fedora-session-tcsh for tcsh, etc.). This binary would, when launched as a
> login shell, launch all the necessary daemons, run the specified "real" login
> shell, an kill the daemons after the shell exits.
> IOW, replace
> exec -l $SHELL -c "$SSH_AGENT $DBUS_LAUNCH /etc/X11/xinit/Xclients"
> by a simple
> exec -l $SHELL
> and let $SHELL take care of all the necessary daemons.
> If fedora-session-bash were run as a non-login shell, it would simply exec bash.
> This is cleaner than patching each getty/?dm/whatever separately; as an added
> benefit, it would unify the X and non-X launch path.
I don't think that'll scale well across networks, which won't have the wrapper
on every workstation, or in /etc/shells.
I'm also trying to avoid running the shell directly under ssh-agent -- because
it's setgid, libc discards $LD_LIBRARY_PATH (see ld.so(8)), and that surprises
people who depend on that.
Based on the date this bug was created, it appears to have been reported
during the development of Fedora 8. In order to refocus our efforts as
a project we are changing the version of this bug to '8'.
If this bug still exists in rawhide, please change the version back to
(If you're unable to change the bug's version, add a comment to the bug
and someone will change it for you.)
Thanks for your help and we apologize for the interruption.
The process we're following is outlined here:
We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '8'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 8's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 8 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.
See bug #631740