Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 240468

Summary: net-misc/openssh - ssh-agent : wrong export of SSH_AGENT_PID and SSH_AUTH_SOCK (net-misc/openssh-5.1_p1-r1)
Product: Gentoo Linux Reporter: Cyrius <cyrius>
Component: Current packagesAssignee: Robin Johnson <robbat2>
Status: RESOLVED INVALID    
Severity: normal CC: base-system
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Cyrius 2008-10-08 08:58:47 UTC
when i launch ssh-agent, it says :
SSH_AUTH_SOCK=/tmp/ssh-glvrki1140/agent.1140; export SSH_AUTH_SOCK;
SSH_AGENT_PID=1141; export SSH_AGENT_PID;
echo Agent pid 1141;

which should be ok.
But when i do an 'echo $SSH_AGENT_PID' : nothing.
I can't use ssh-add too. It claims that the PID is not know.



Reproducible: Always

Steps to Reproduce:
1.run ssh-agent
2.try to use ssh-add
3.

Actual Results:  
ssh-add claims that the ssh-agent is not running because the SSH_AGENT_PID is empty.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-10-08 14:56:36 UTC
Please post your `emerge --info' too.
Comment 2 Cyrius 2008-10-08 15:07:06 UTC
emerge --info
Portage 2.2_rc11 (default/linux/x86/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r0, 2.6.26-gentoo i686)
=================================================================
System uname: Linux-2.6.26-gentoo-i686-Intel-R-_Core-TM-2_Duo_CPU_T7700_@_2.40GHz-with-glibc2.0
Timestamp of tree: Wed, 08 Oct 2008 08:45:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7, 2.1.6-r1
dev-lang/python:     2.4.4-r4, 2.5.2-r8
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.3.0
sys-apps/sandbox:    1.2.18.1-r3
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.26
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe -fomit-frame-pointer -mmmx -msse3         -mfpmath=sse -maccumulate-outgoing-args"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.qubenet.net/mirror/gentoo/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LC_ALL="fr_FR.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="fr"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi alsa arts audiofile avi berkdb bidi bzip2 bzlib cairo cdda cdparanoia cli cracklib crypt cups curl dbus dell dri dts dv dvd dvdr dvdread encode fam ffmpeg foomatic fortran freetype gd gdbm gif gimp glibc-omitfp glitz gpm gtk gtk2 hal iconv isdnlog java jpeg jpeg2k kde lame libwww loop-aes lua mad madwifi matroska midi mmx mng mozilla mp3 mpeg mudflap ncurses nls nptl nptlonly ogg oggvorbis opengl openmp oss pam pcre pdf perl png ppds pppd python qt3 qt4 quicktime rdesktop readline reflection samba sdl session slp spell spl sse sse2 sse3 ssl ssse3 svg svga sysfs tcpd theora tiff truetype unicode v4l v4l2 vmware vorbis wavpack wifi win32codecs wmf wmv x86 xcomposite xorg xscreensaver xv xvid zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" USERLAND="GNU" VIDEO_CARDS="nvidia vesa vga vmware"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-10-14 07:26:29 UTC
You are supposed to eval the output of ssh-agent.

I quote from the manpage:
=====
There are two main ways to get an agent set up: The first is that the agent starts a new subcommand into which some environment variables are exported, eg ssh-agent xterm &.  The second is that the agent prints the needed shell commands
(either sh(1) or csh(1) syntax can be generated) which can be evalled in the calling shell, eg eval ‘ssh-agent -s‘ for Bourne-type shells such as sh(1) or ksh(1) and eval ‘ssh-agent -c‘ for csh(1) and derivatives.
=====

Alternatively, look at the Gentoo keychain tool.