diff --git a/pkg/sshx/client.go b/pkg/sshx/client.go index 0808398..ac26fd0 100644 --- a/pkg/sshx/client.go +++ b/pkg/sshx/client.go @@ -75,9 +75,10 @@ func NewClient(config *Config, options ...Option) (*Client, error) { if client.SSH, err = ssh.Dial("tcp", address, normalizedConfig); err != nil { return nil, err } - if client.SFTP, err = sftp.NewClient(client.SSH); err != nil { - return nil, err - } + } + + if client.SFTP, err = sftp.NewClient(client.SSH); err != nil { + return nil, err } return client, nil