1
0
mirror of https://github.com/rancher/os.git synced 2025-07-01 09:11:48 +00:00
os/cmd/cloudinit/authorizeSSHKeys.go

18 lines
334 B
Go
Raw Normal View History

package cloudinit
import(
"os/exec"
log "github.com/Sirupsen/logrus"
)
func authorizeSSHKeys(user string, authorizedKeys []string, name string) {
for _, authorizedKey := range authorizedKeys {
cmd := exec.Command("update-ssh-keys", user, authorizedKey)
err := cmd.Run()
if err != nil {
log.Fatal(err.Error())
}
}
}