fix: better borked ssh config message
continuous-integration/drone/push Build is passing Details

See coop-cloud/organising#243.
This commit is contained in:
decentral1se 2021-11-19 15:29:17 +01:00
parent fc51cf7775
commit 1b836dbab6
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 41 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"strings"
abraFormatter "coopcloud.tech/abra/cli/formatter"
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/pkg/catalogue"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/ssh"
@ -72,7 +73,7 @@ can take some time.
for _, app := range apps {
if err := ssh.EnsureHostKey(app.Server); err != nil {
logrus.Fatal(err)
logrus.Fatal(fmt.Sprintf(internal.SSHFailMsg, app.Server))
}
}

View File

@ -271,3 +271,42 @@ var DebugFlag = &cli.BoolFlag{
Destination: &Debug,
Usage: "Show DEBUG messages",
}
// SSHFailMsg is a hopefully helpful SSH failure message
var SSHFailMsg = `
Woops, Abra is unable to connect to connect to %s.
Here are a few tips for debugging your local SSH config. Abra uses plain 'ol
SSH to make connections to servers, so if your SSH config is working, Abra is
working.
Is your ssh-agent running? You can start it by running the following command:
eval "$(ssh-agent)"
If your SSH private key loaded? You can check by running the following command:
ssh-add -L
If you are using a non-default public/private key, you can configure this in
your ~/.ssh/config file which Abra will read in order to figure out connection
details:
Host foo.coopcloud.tech
Hostname foo.coopcloud.tech
User bar
Port 12345
IdentityFile ~/.ssh/bar@foo.coopcloud.tech
If you're only using password authentication, you can use the following config:
Host foo.coopcloud.tech
Hostname foo.coopcloud.tech
User bar
Port 12345
PreferredAuthentications=password
PubkeyAuthentication=no
Good luck!
`