-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minecraft user is not able to execute minecraftctl start {instance name}
without root password prompt
#4
Comments
I guess the documentation isn't explicit enough. I assume you have a service user and group What you need is a group that is allowed to manage the minecraft server, e.g. You then can add a line that will allow all members of that
Side note: This line will give the
If anyone manages to get remote code execution via your minecraft server (e.g. an infected plugin or a security issue in some http server that a plugin (like dynmap or luckperms) starts) then this attacker can do ANYTHING on your server! I'd suggest you remove / replace that line. Side note 2: You might want to put this line in a extra file inside the Side note 3: Of course you might want to just have an admin with full access without having to enter a password every time, then this line should do (change group as required):
Keep in mind that this is a small security risk, but you can mitigate it by hardening your ssh config to only allow secure cypher, the latest protocol and public key authentication. |
Thanks @seyfahni I'll try it out later this week. What I've done for the moment is add
Edited the script to execute this command
This seems to bypass the need to enter the password however I'm not sure if executing commands using |
This works too and only allows management of the server, but for the minecraft user itself too, you can keep it as is if you're fine with that.
I would keep the script in its original version for multiple reasons (especially the part that you removed): if [[ "$(id -un)" != "$MINECRAFT_USER" ]]; then
sudo -n -u "$MINECRAFT_USER" "$SAFE_SELF" "$@"
exit
fi The script is written so that it calls itself as the root user via sudo. The only permission youe have to give an admin is that they can run the script as root (the sudoers line). But if the script contains
But that would allow the user to manage ALL services (ssh, databases), not only the minecraft ones and gives essentially root access (you can do Your current script probably works for you as you have full access (you can just run
And you can run my original script with explicit sudo: |
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 executingminecraftctl start {instance name}
either with the userminecraft
or root I get the following prompt.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.
The only way I managed to get the script to run without the prompt is by using sudo and removing the below from
minecraftctl
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))
The text was updated successfully, but these errors were encountered: