actually sudo as user as intended
parent
6a1fcbcf32
commit
015b28ba6a
|
@ -149,7 +149,7 @@ func createUser(data newUserData) (err error) {
|
||||||
return fmt.Errorf("usermod failed: %w", err)
|
return fmt.Errorf("usermod failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = exec.Command("sudo", "/town/bin/createkeyfile", data.Username)
|
cmd = exec.Command("sudo", "--user", data.Username, "/town/bin/createkeyfile", data.Username)
|
||||||
cmd.Stdin = bytes.NewBufferString(keyfileText(data))
|
cmd.Stdin = bytes.NewBufferString(keyfileText(data))
|
||||||
if err = cmd.Run(); err != nil {
|
if err = cmd.Run(); err != nil {
|
||||||
return fmt.Errorf("createkeyfile failed: %w", err)
|
return fmt.Errorf("createkeyfile failed: %w", err)
|
||||||
|
|
Loading…
Reference in New Issue