[Bug 1236299] [NEW] ssh-agent env variables not set when not using Bourne shell
Andrew Stevenson
andrew at ugh.net.au
Mon Oct 7 11:00:56 UTC 2013
Public bug reported:
When I start an X session (default gnome/unity setup) I find that ssh-
agent is started but the appropriate environment variables
(SSH_AGENT_PID, SSH_AUTH_SOCK) are not set. .xsession-errors contains:
init: ssh-agent pre-start process (1797) terminated with status 127
The problem appears to be in /usr/share/upstart/sessions/ssh-agent.conf.
It evals ssh-agent expecting the output to be valid Bourne shell syntax
however ssh-agent checks (IIUC) the user's shell and output C shell
style code if the user is using a C based shell. I use tcsh and so get
output like 'setenv SSH_AGENT_PID ...' from ssh-agent. This of course
fails to set any environment variables in the Bourne shell script that
the upstart job effectively is.
Luckily ssh-agent has a flag to ask for Bourne shell syntax.
--- ssh-agent.conf.orig 2013-10-07 11:30:08.546222472 +0200
+++ ssh-agent.conf 2013-10-07 11:30:30.858221774 +0200
@@ -7,7 +7,7 @@
[ -e /etc/X11/Xsession.options ] || { stop; exit 0; }
grep -q "^use-ssh-agent$" /etc/X11/Xsession.options || { stop; exit 0; }
- eval "$(ssh-agent)" >/dev/null
+ eval "$(ssh-agent -s)" >/dev/null
initctl set-env --global SSH_AUTH_SOCK=$SSH_AUTH_SOCK
initctl set-env --global SSH_AGENT_PID=$SSH_AGENT_PID
end script
ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: openssh-client 1:6.2p2-6 [modified: usr/share/upstart/sessions/ssh-agent.conf]
ProcVersionSignature: Ubuntu 3.11.0-11.17-generic 3.11.3
Uname: Linux 3.11.0-11-generic x86_64
ApportVersion: 2.12.5-0ubuntu1
Architecture: amd64
Date: Mon Oct 7 12:50:45 2013
InstallationDate: Installed on 2013-06-28 (101 days ago)
InstallationMedia: Ubuntu 12.04.2 LTS "Precise Pangolin" - Release amd64 (20130213)
MarkForUpload: True
RelatedPackageVersions:
ssh-askpass N/A
libpam-ssh N/A
keychain N/A
ssh-askpass-gnome 1:6.2p2-6
SSHClientVersion: OpenSSH_6.2p2 Ubuntu-6, OpenSSL 1.0.1e 11 Feb 2013
SourcePackage: openssh
UpgradeStatus: Upgraded to saucy on 2013-09-23 (14 days ago)
** Affects: openssh (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug saucy
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to openssh in Ubuntu.
https://bugs.launchpad.net/bugs/1236299
Title:
ssh-agent env variables not set when not using Bourne shell
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1236299/+subscriptions
More information about the Ubuntu-server-bugs
mailing list