[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#714435: openssh-client: please support reattach to existing ssh-agent



Package: openssh-client
Severity: wishlist
Tags: upstream

Dear maintainer,

sometimes I work on a project in a separate sandbox, set up under the same UID as my primary user, but with a different home directory. This allows for custom dotfiles,
specific to that user. (If interested, see
 http://www.gramps-project.org/wiki/index.php?title=Getting_started_with_Gramps_development#Another_user
for more info on creating such a setup).

When I switch to that environment, I use "su". Unfortunately, it sanitizes the env., cleaning away the SSH_AGENT_... environment, even though the UID is not changed.

I would like to have an option to ask ssh-agent to dump the script to reattach to the existing agent, reusing the logic behind the current implementation of the
"-k" option and the "-c / -s" option. Something like
  ssh-agent [ -c | -s ] --reattach
or similar.

I could then execute that command under my primary user shell, and then
paste the script it outputs to the sandbox shell, to reattach to the same agent.

Meanwhile, I am just using the following script locally, called ssh-agent-reattach:
===cut here===
#!/bin/bash
if [ "x$SSH_AGENT_PID" = "x" ]; then
        echo No ssh-agent running...
        exit 1
fi

echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK; export SSH_AUTH_SOCK;"
echo "SSH_AGENT_PID=$SSH_AGENT_PID; export SSH_AGENT_PID;"
echo "echo Agent pid $SSH_AGENT_PID;"
===cut here===

If this seems sensible to you, could you please raise this with upstream?

Thanks a lot for packaging openssh-client,
VKh


Reply to: