Skip to content

Commit

Permalink
allow for multiple default identity key files
Browse files Browse the repository at this point in the history
  • Loading branch information
memetb committed Oct 13, 2024
1 parent b56a61c commit 6c6d773
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 @@ -18,7 +18,7 @@ import (
const (
maxHostHops = 10
defaultSSHPort = "22"
defaultSSHKeyPath = "${HOME}/.ssh/id_rsa"
defaultSSHKeyPaths = "${HOME}/.ssh/id_rsa,${HOME}/.ssh/id_ed25519"
defaultSSHKnownHostsPath = "${HOME}/.ssh/known_hosts"
defaultSSHConfigFile = "${HOME}/.ssh/config"
defaultSSHAuthMethods = "agent,privkey"
Expand Down Expand Up @@ -53,7 +53,7 @@ func (u *ConnectionURI) parseAuthMethods(target string, sshcfg *ssh_config.Confi

if len(keyPaths) == 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 6c6d773

Please sign in to comment.