diff --git a/src/cmd/initContainer.go b/src/cmd/initContainer.go index c1d8e85..b1040fa 100644 --- a/src/cmd/initContainer.go +++ b/src/cmd/initContainer.go @@ -393,6 +393,7 @@ func configureUsers(targetUserUid int, targetUser, targetUserHome, targetUserShe "--groups", sudoGroup, "--home-dir", targetUserHome, "--no-create-home", + "--password", "", "--shell", targetUserShell, "--uid", fmt.Sprint(targetUserUid), targetUser, @@ -413,6 +414,7 @@ func configureUsers(targetUserUid int, targetUser, targetUserHome, targetUserShe "--append", "--groups", sudoGroup, "--home", targetUserHome, + "--password", "", "--shell", targetUserShell, "--uid", fmt.Sprint(targetUserUid), targetUser, @@ -428,12 +430,6 @@ func configureUsers(targetUserUid int, targetUser, targetUserHome, targetUserShe } } - logrus.Debugf("Removing password for user %s", targetUser) - - if err := shell.Run("passwd", nil, nil, nil, "--delete", targetUser); err != nil { - return fmt.Errorf("failed to remove password for user %s: %w", targetUser, err) - } - logrus.Debug("Removing password for user root") if err := shell.Run("passwd", nil, nil, nil, "--delete", "root"); err != nil {