Skip to content

Minecraft user is not able to execute minecraftctl start {instance name} without root password prompt #4

@frg

Description

@frg

Hi,

What permissions does the minecraft user need?

I've got the user set up using useradd --system --no-create-home --home /opt/minecraft -g minecraft minecraft yet when executing minecraftctl start {instance name} either with the user minecraft or root I get the following prompt.

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'minecraft@{instance name}.service'.
Authenticating as: root
Password:

To get around this online sources mention the use of a sudoers entry, which I've tried the below as a catch-all for the moment yet it didn't work.

%minecraft ALL=(ALL) NOPASSWD:ALL

The only way I managed to get the script to run without the prompt is by using sudo and removing the below from minecraftctl

if [[ "$(id -un)" != "$MINECRAFT_USER" ]]; then
  sudo -n -u "$MINECRAFT_USER" "$SAFE_SELF" "$@"
  exit
fi

I'm sure I'm missing something,
Thanks in advance.

Linux version 5.4.0-77-generic (buildd@lgw01-amd64-028) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04))

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions