mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
b10b13b173
* Add test logger * Refactor access manager logging * Refactor activation service logging * Refactor debugd logging * Refactor kms server logging * Refactor disk-mapper logging Signed-off-by: Daniel Weiße <dw@edgeless.systems>
24 lines
646 B
Go
24 lines
646 B
Go
package core
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/edgelesssys/constellation/internal/deploy/ssh"
|
|
"github.com/edgelesssys/constellation/internal/logger"
|
|
"go.uber.org/zap/zapcore"
|
|
)
|
|
|
|
// CreateSSHUsers creates UNIX users with respective SSH access on the system the coordinator is running on when defined in the config.
|
|
func (c *Core) CreateSSHUsers(sshUserKeys []ssh.UserKey) error {
|
|
sshAccess := ssh.NewAccess(logger.New(logger.JSONLog, zapcore.InfoLevel), c.linuxUserManager)
|
|
ctx := context.Background()
|
|
|
|
for _, pair := range sshUserKeys {
|
|
if err := sshAccess.DeployAuthorizedKey(ctx, pair); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|