Replace Go SSH library with native ssh command
Major rewrite to use native ssh command instead of Go SSH library: BREAKING CHANGE: Now requires ssh command in PATH Benefits: - Full SSH feature support including ProxyCommand - Works with SSH containers and jump hosts - Supports all SSH authentication methods - Consistent behavior with terminal SSH - No more custom SSH client implementation Changes: - Port detection now uses 'ssh hostname command' - Port forwarding uses 'ssh -L localport:localhost:remoteport hostname' - Connection testing uses native ssh command - Removed golang.org/x/crypto/ssh dependency - Updated documentation to reflect SSH compatibility This fixes issues with SSH containers that require ProxyCommand and provides full compatibility with user SSH configurations. Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -175,11 +175,15 @@ func (sc *SSHConfig) GetHosts() []SSHHost {
|
||||
return sc.Hosts
|
||||
}
|
||||
|
||||
// GetHostByName returns a specific host by name
|
||||
// GetHostByName returns a specific host by name with expanded variables
|
||||
func (sc *SSHConfig) GetHostByName(name string) (*SSHHost, error) {
|
||||
for _, host := range sc.Hosts {
|
||||
if host.Name == name {
|
||||
return &host, nil
|
||||
// Return a copy with expanded shell variables
|
||||
expandedHost := host
|
||||
expandedHost.User = expandShellVars(host.User)
|
||||
expandedHost.Identity = expandShellVars(host.Identity)
|
||||
return &expandedHost, nil
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("host '%s' not found", name)
|
||||
|
Reference in New Issue
Block a user