diff --git a/cmd/headscale/cli/debug.go b/cmd/headscale/cli/debug.go index 46bdb9e8..226ae5e7 100644 --- a/cmd/headscale/cli/debug.go +++ b/cmd/headscale/cli/debug.go @@ -77,6 +77,16 @@ var createNodeCmd = &cobra.Command{ return } + if len(machineKey) != 64 { + err = fmt.Errorf("key '%s' too short, must be 64 hexadecimal characters", machineKey) + ErrorOutput( + err, + fmt.Sprintf("Error: %s", err), + output, + ) + + return + } routes, err := cmd.Flags().GetStringSlice("route") if err != nil {