Skip to content

Commit

Permalink
Add Machine ID tip when tctl auth sign is used (gravitational#27804)
Browse files Browse the repository at this point in the history
* Add prompt to machine id page when using `tctl auth sign` for a user credential

* Use FPrintf with stderr instead of `log.Info`

* Move newline

* Remove emoji from message in case it breaks terminals
  • Loading branch information
strideynet authored Jun 16, 2023
1 parent 95e6482 commit 4151218
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tool/tctl/common/auth_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,13 @@ func (a *AuthCommand) generateUserKeys(ctx context.Context, clusterAPI auth.Clie
if err != nil {
return trace.Wrap(err)
}
fmt.Printf("\nThe credentials have been written to %s\n", strings.Join(filesWritten, ", "))
// Print a tip guiding people towards Machine ID. We use stderr here in case
// someone is programatically parsing stdout.
_, _ = fmt.Fprintln(
os.Stderr,
"\nGenerating credentials to allow a machine access to Teleport? We recommend Teleport's Machine ID! Find out more at https://goteleport.com/r/machineid-tip",
)
fmt.Printf("The credentials have been written to %s\n", strings.Join(filesWritten, ", "))

return nil
}
Expand Down

0 comments on commit 4151218

Please sign in to comment.