mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-16 10:40:31 -04:00
debugd: Allow root login on serial console when using debug image (#407)
This commit is contained in:
parent
a796c7ee69
commit
f5270c6c01
2 changed files with 22 additions and 0 deletions
18
debugd/internal/debugd/deploy/seriallogin.go
Normal file
18
debugd/internal/debugd/deploy/seriallogin.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package deploy
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
// DeleteUserPassword sets the user's password to an empty string
|
||||
// effectively allowing anyone with access to the serial console to log in.
|
||||
func DeleteUserPassword(ctx context.Context, user string) error {
|
||||
cmd := exec.CommandContext(ctx, "passwd", "-d", user)
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return fmt.Errorf("deleting user password: %q %w", output, err)
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue