Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several improvements #115

Closed
wants to merge 5 commits into from
Closed

Several improvements #115

wants to merge 5 commits into from

Conversation

abakum
Copy link

@abakum abakum commented May 14, 2024

No description provided.

@abakum
Copy link
Author

abakum commented May 14, 2024

After that PR, agent forwarding started working for me

@@ -1178,10 +1178,12 @@ func sshAgentForward(args *sshArgs, param *sshParam, client *ssh.Client, session
warning("forward agent but the socket address is not set")
return
}
if err := forwardToRemote(client, addr); err != nil {

if err := agent.ForwardToAgent(client, getAgentClient(args, param)); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1password doesn't support keep using the same agent connection. #51

})

// Ssh agent forwarding must start before session.Shell or session.Command.
agentForwarding = func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite follow this.

conn.Close()
agentClient = nil
})
if args.ForwardAgent {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also args.NoForwardAgent and strings.ToLower(getOptionConfig(args, "ForwardAgent")) == "yes".

// Let's postpone forwarding - maybe we won't have to do it.
afterLoginFuncs = append(afterLoginFuncs, func() {
// ssh forward
sshForward(ss.client, args, param)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning message should be output before logging in, but now it may be output after logging in.

conn, err := winio.DialPipe(addr, &timeout)

if err != nil { // Plan B.
conn, err = pageant.NewConn()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check whether openssh agent or pageant is currently running first.

@lonnywong
Copy link
Member

pageant merged with changes as b518f22

@lonnywong lonnywong closed this May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants