Skip to content

Commit

Permalink
Explicitly set the IdentityAgent path when using the issue mode
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
LeSuisse committed Aug 24, 2023
1 parent c9fb46a commit e98397c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func processCommand() int {
// override default ssh-agent socket
os.Setenv("SSH_AUTH_SOCK", agent.SocketFile())
log.Debugf("set SSH_AUTH_SOCK to %q\n", agent.SocketFile())
sshClient.PrependArgs([]string{"-o", "IdentityAgent=SSH_AUTH_SOCK"})

case "sign":
signedKey, err := vaultClient.SignKey(sshClient.User)
Expand Down

0 comments on commit e98397c

Please sign in to comment.