byobu-export and SSH_AUTH_SOCK

Bug #616899 reported by Randy Melton
This bug report is a duplicate of:  Bug #664059: byobu breaks $SSH_AUTH_SOCK. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
Invalid
Low
Unassigned

Bug Description

(first I apologize if this bug is misguided, please dispose of it accordingly. I admit I have not read the man pages in great detail!)

My situation: I want to use byobu-export to create 'nice' screen settings for use on an older system where byobu is not installed.

I also use ssh-agent on that older system. I start a screen and the SSH_AUTH_SOCK is incorrect in the screen children?
I assume this was the value "exported" from my first system?

I plan to comment out the SSH_AGENT_SOCK line in ~/.byobu/profile to avoid this problem.
> # Maintain SSH_AUTH_SOCK link
> setenv SSH_AUTH_SOCK /var/run/screen/S-$USER/byobu.ssh-agent

But... I can't help but think someone went to great trouble to put that line there so I must be missing something because I can't see a use for it in my exported config scenario?

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hi Randy, thanks for the report.

First, could you try the latest 3.x byobu tarball from https://launchpad.net/byobu/+download? These use "./configure --prefix=/path/to/wherever && make && make install" style installation, and have subsequently deprecated byobu-export.

Secondly (and more to the point of your bug), where is your SSH_AUTH_SOCK located?

The "setenv SSH_AUTH_SOCK /var/run/screen/S-$USER/byobu.ssh-agent" points SSH_AUTH_SOCK to a symlink that byobu tries to maintain against the real socket. You can certainly comment that line out, but it will be up to you (and your shell profile, etc) to maintain the accuracy of that socket across multiple attaches/detaches. That's the reason for the link. It allows Byobu to always look for that socket at the same path, which is a link that can be trivially updated.

I suspect (?) that your problem is that /var/run/screen/* doesn't exist for you on this system where byobu isn't actually installed from the package?

Changed in byobu:
status: New → Incomplete
importance: Undecided → Low
Revision history for this message
Randy Melton (seadevil) wrote :

Q1/A1: will try.... (I run the default kubuntu 10.4 version)

Q2/A2: SSH_AUTH_SOCK=/tmp/ssh-Kxden15846/agent.15846
(I run ssh-agent manually on that older system, then set/export the env's)

understood. when I log into the remote system I typically create a new ssh-agent.
(I usually only log in once, and keep the window open for weeks) I use screen on that system
(in that konsole tab) to manage what are effectivly "sub-tabs" in konsole. Those subtabs are used
to run big batch jobs.

thinking out loud...
if I were to disconnect/reconnect I would like the reconnected screens to "remember" their env
(ie SSH_AGENT) and I think they do... If I were to create new child-screens they would use whatever
env the screen process inherited (which might be different from existing child-screens)

So something is supposed to record the SSH env at the first invocation of screen (in
/var/run/screen/S-$USER/byobu.ssh-agent) so that future reconnects can use it.
(AHA.. maybe in some environments the ssh-agent changes dies/restarts and you try
to keep it fresh in all existing child-screens?)

My /var/run/screen/S-$USER does exist but it does not contain a byobu.ssh-agent?

If I invoke "screen" what is supposed to seed ...byobu.ssh-agent?

thanks (for both the tool and your help)

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 616899] Re: byobu-export and SSH_AUTH_SOCK

Right, so in the default, packaged, "real install" of byobu, you start
it using /usr/bin/byobu that has some code that reconnects and
maintains $SSH_AUTH_SOCK.

If you just run "screen" with the byobu-export hack, you're skipping
that maintenance code, unfortunately.

I bet that if you use the byobu-3.1 tarball and make/make-install,
this should now work for you.

You're welcome ;-)

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Closing this, as I haven't heard back and I'm pretty sure the above instructions will solve this issue.

Changed in byobu:
status: Incomplete → Invalid
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Actually, I think this is a dupe of bug #664059, which I just uploaded a fix for.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.