Bug 1227767 - ssh-agent unable to export its variables
Summary: ssh-agent unable to export its variables
Status: RESOLVED INVALID
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Network (show other bugs)
Version: Current
Hardware: aarch64 openSUSE Tumbleweed
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-15 08:53 UTC by Tamara Schmitz
Modified: 2024-07-16 15:08 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
ssh-agent strace (8.21 KB, text/plain)
2024-07-15 08:53 UTC, Tamara Schmitz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tamara Schmitz 2024-07-15 08:53:36 UTC
Created attachment 876048 [details]
ssh-agent strace

In a bash shell, launching ssh-agent is unable to export its variables after launching. I observed this both on a desktop and a headless MicroOS system both running aarch64 CPUs from different vendors and different microarchitectures. So I believe this to be an aarch64 specific bug.

The ssh-agent binary is part of the openssh-clients package which is built from the openssh.spec.

Observed behaviour:
$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-XXXXXX4k26MF/agent.26053; export SSH_AUTH_SOCK;
SSH_AGENT_PID=26054; export SSH_AGENT_PID;
echo Agent pid 26054;
$ ssh-agent -k
SSH_AGENT_PID not set, cannot kill agent
$ printenv | grep -i SSH
$

System Info:
openSUSE Tumbleweed Aarch64 VERSION_ID="20240629"
openssh-clients-9.6p1-11.1.aarch64
SELinux originally Enforcing, but using setenforce changed to Permissive. No change.

Attached is an strace of running ssh-agent.
Comment 1 Tamara Schmitz 2024-07-15 08:55:18 UTC
As an additional note. The export is failing and so `ssh-agent -k` is failing but ssh-agent is running as I can confirm with `pidof ssh-agent`. The envs are not set correctly, that is the problem.
Comment 2 Neil Rickert 2024-07-16 00:34:22 UTC
To me, this looks normal.

If you use the command:

 ssh-agent bash

Then it will export its environment variable to the "bash" shell that it starts.

But if you just use:

 ssh-agent

then there is no subcommand to which it can export.

You should probably be using:

 eval `ssh-agent -s`

or

 eval $(ssh-agent -s)

When starting "ssh-agent" this way, its output is caught by the shell and then run as a shell command.  And the shell then exports the needed variables.

Check the man pages for "ssh-agent".
Comment 3 Tamara Schmitz 2024-07-16 15:08:21 UTC
Yeah oops. Does seem to be a misunderstanding on my part.