diff --git a/pkg/backy/ssh.go b/pkg/backy/ssh.go index 4984b08..c7ff1c5 100644 --- a/pkg/backy/ssh.go +++ b/pkg/backy/ssh.go @@ -75,12 +75,11 @@ func (remoteConfig *Host) ConnectToSSHHost() (*ssh.Client, error) { } remoteConfig.HostName, _ = cfg.GetAll(remoteConfig.Host, "HostName") if remoteConfig.HostName == nil { - remoteConfig.HostName[0] = remoteConfig.Host port, _ := cfg.Get(remoteConfig.Host, "Port") if port == "" { port = "22" } - remoteConfig.HostName[0] = remoteConfig.HostName[0] + ":" + port + remoteConfig.HostName[0] = remoteConfig.Host + ":" + port } else { for index, hostName := range remoteConfig.HostName { port, _ := cfg.Get(remoteConfig.Host, "Port") @@ -88,6 +87,7 @@ func (remoteConfig *Host) ConnectToSSHHost() (*ssh.Client, error) { port = "22" } remoteConfig.HostName[index] = hostName + ":" + port + println("HostName: " + remoteConfig.HostName[0]) } } privateKey, err := os.ReadFile(remoteConfig.PrivateKeyPath)