File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,9 @@ func processCommand() int {
111111 // override default ssh-agent socket
112112 os .Setenv ("SSH_AUTH_SOCK" , agent .SocketFile ())
113113 log .Debugf ("set SSH_AUTH_SOCK to %q\n " , agent .SocketFile ())
114- sshClient .PrependArgs ([]string {"-o" , "IdentityAgent=SSH_AUTH_SOCK" })
114+ if sshClient .ForceIdentityAgent {
115+ sshClient .PrependArgs ([]string {"-o" , "IdentityAgent=SSH_AUTH_SOCK" })
116+ }
115117
116118 case "sign" :
117119 signedKey , err := vaultClient .SignKey (sshClient .User )
Original file line number Diff line number Diff line change @@ -15,14 +15,15 @@ import (
1515)
1616
1717type Client struct {
18- Args []string
19- HostConfig []string
20- User string
21- Hostname string
22- Extensions Extensions
23- CertificateString string
24- CertificateFile string
25- CertificateObject * ssh.Certificate
18+ Args []string
19+ HostConfig []string
20+ User string
21+ Hostname string
22+ Extensions Extensions
23+ CertificateString string
24+ CertificateFile string
25+ CertificateObject * ssh.Certificate
26+ ForceIdentityAgent bool
2627}
2728
2829// Options for https://man.openbsd.org/ssh.1; parsed simply to provide accurate Destination and RemoteCommand
@@ -127,6 +128,8 @@ func (c *Client) ParseConfig() error {
127128 if value == "yes" {
128129 c .Extensions .X11Forwarding = true
129130 }
131+ case "identityagent" :
132+ c .ForceIdentityAgent = true
130133 case "localforward" :
131134 c .Extensions .PortForwarding = true
132135 case "remoteforward" :
You can’t perform that action at this time.
0 commit comments