Skip to content

Commit

Permalink
allow for multiple default identity key files (#1112)
Browse files Browse the repository at this point in the history
* allow for multiple default identity key files

* add ecdsa and reorder rsa to be last
  • Loading branch information
memetb authored Oct 19, 2024
1 parent 0263f35 commit 1cd90b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libvirt/uri/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
const (
maxHostHops = 10
defaultSSHPort = "22"
defaultSSHKeyPath = "${HOME}/.ssh/id_rsa"
defaultSSHKeyPaths = "${HOME}/.ssh/id_ed25519,${HOME}/.ssh/id_ecdsa,${HOME}/.ssh/id_rsa"
defaultSSHKnownHostsPath = "${HOME}/.ssh/known_hosts"
defaultSSHConfigFile = "${HOME}/.ssh/config"
defaultSSHAuthMethods = "agent,privkey"
Expand Down Expand Up @@ -55,7 +55,7 @@ func (u *ConnectionURI) parseAuthMethods(target string, sshcfg *ssh_config.Confi

if len(sshKeyPaths) == 0 {
log.Printf("[DEBUG] found no ssh keys, using default keypath")
sshKeyPaths = []string{defaultSSHKeyPath}
sshKeyPaths = strings.Split(defaultSSHKeyPaths, ",")
}

log.Printf("[DEBUG] ssh identity files for host '%s': %s", target, sshKeyPaths)
Expand Down

0 comments on commit 1cd90b7

Please sign in to comment.