Skip to content

Commit e98397c

Browse files
committed
Explicitly set the IdentityAgent path when using the issue mode
This make sure the appropriate path is used even if the IdentityAgent is set in a config. Without this change a user with the following config will not be able to connect because the SSH_AUTH_SOCK env variable will be overriden: ``` Host * IdentityAgent none IdentityFile ~/.ssh/id_ecdsa_sk ```
1 parent c9fb46a commit e98397c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ 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"})
114115

115116
case "sign":
116117
signedKey, err := vaultClient.SignKey(sshClient.User)

0 commit comments

Comments
 (0)