forked from dmacvicar/terraform-provider-libvirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expanded ssh_config parameters for qemu+ssh uri option (dmacvicar#1059)
* bump ssh_config to stable version which contains GetAll call * refactor dialSSH and break out dialHost as support function * move authentication parsing to per host part of loop this allows different hosts (jump hosts) to have different identity files specified * implement per Host identity file lookup * fix tilde (~) based home directory notation for convenience * updated go.sum * cleanup log outputs * remove unnecessary local variable * make use of net package URI building to support correct ipv6 as per commit from MaxMatti: dmacvicar@1152bdd * correctly use host:port format when dialing bastion host * put quotes around target in case it is empty * if the hostname override isn't present, simply use target name * add log output for port override * add default host key algorithm * move port configuration earlier so that hostkey callback works right the hostKeyCallback makes use of the SSH port and fails if a custom ssh port is being used by the host * cleanup log output, add error handling for dial host * add support for sshconfig based known hosts file behaviour * integrate HostKeyAlgorithms ssh_config option * move dial host impl so that bastion hosts have same features * add comments * use a more modern default host key this value was chosen as the lowest RSA available by default on a debian build running OpenSSH_9.2 and works out of the box for most hosts tested by authority. Any older systems can specifically set their key algorithms in .ssh/config * update auth method parse to allow for multiple private ssh keys * use a list of hostKeyAlgorithms instead of just one default * use camelCase to match go coding styles * use join instead of replace for a more predictable outcome replace could have resulted in weird behaviour such as "some~path" becoming incorrectly mangled * remove log.Fatal and let the upper layer deal with the logging * change magic number to constant * code formatting to match go coding style * add missing import for filepath module (0da4763) * lint fixes
- Loading branch information
Showing
3 changed files
with
193 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters