Skip to content

Commit

Permalink
Handle the default case for ssh_authorized_keys in cloud-config
Browse files Browse the repository at this point in the history
If no user is defined in cloud config, ssh_authorized_keys will be
assigned to the root user.

Signed-off-by: Darren Shepherd <[email protected]>
  • Loading branch information
ibuildthecloud committed Oct 18, 2021
1 parent d7c41b4 commit 5caa68e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/schema/loader_cloudinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ func (cloudInit) Load(s []byte, fs vfs.FS) (*YipConfig, error) {
}
}

// If no users are defined, then assume global ssh_authorized_keys is assigned to root
if len(userstoKey) == 0 && len(cc.SSHAuthorizedKeys) > 0 {
sshKeys["root"] = cc.SSHAuthorizedKeys
}

// Decode writeFiles
var f []File
for _, ff := range cc.WriteFiles {
Expand Down

0 comments on commit 5caa68e

Please sign in to comment.