Adding "-r", to create a system user to not show up on user login screen

This commit is contained in:
2025-09-29 19:21:24 -03:00
parent 9cf5ae61d8
commit bb4f221fc9

View File

@@ -398,7 +398,7 @@ skipping:
}
func GetPacketsUID() (int, error) {
_ = exec.Command("useradd", "-M", "-N", "packets").Run()
_ = exec.Command("useradd", "-M", "-N", "-r", "packets").Run()
cmd := exec.Command("id", "-u", "packets")
out, err := cmd.CombinedOutput()
@@ -416,8 +416,8 @@ func GetPacketsUID() (int, error) {
func ChangeToNoPermission() error {
uid, err := GetPacketsUID()
if err != nil {
return err
if err != nil {
return err
}
return syscall.Setresuid(0, uid, 0)