msmhq / msm

An init script for managing Minecraft servers
http://msmhq.com
GNU General Public License v3.0
1.22k stars 225 forks source link

Here is my sudoers and local/bin wrapper files #328

Open bentterp opened 8 years ago

bentterp commented 8 years ago

[root@tux2 ~]# cat /usr/local/bin/msm

!/bin/bash

if test whoami = "minecraft" ; then /etc/init.d/msm $ else pushd ~minecraft >&/dev/null sudo -u minecraft /etc/init.d/msm $ popd >&/dev/null fi [root@tux2 ~]# cat /etc/sudoers.d/msm %minecraft ALL = (minecraft) NOPASSWD: /etc/init.d/msm *

[root@tux2 ~]#

The effect is that all users in the "minecraft" group can run msm directly - as the minecraft user so files will always get the right ownership and such.

Feel free to include, modify or discard

derrickmehaffy commented 8 years ago

Excellent, just to be clear, none of the other users require sudo correct? And this only effects the msm command not if they edit any of the files under the msm storage (Such as plugin configs)

I dont see anything about edits but just wanted to check.

bentterp commented 8 years ago

Yes it is only for running the msm commands without password prompt.

I did another wrapper called msh which basically gives a shell as the minecraft user, intended to be used when downloading plugins and editing configuration files. Can upload if you are interested.

Regards, Bent

Sent from my Sony Xperia™ smartphone

---- derrickmehaffy wrote ----

Excellent, just to be clear, none of the other users require sudo correct? And this only effects the msm command not if they edit any of the files under the msm storage (Such as plugin configs)

I dont see anything about edits but just wanted to check.

— Reply to this email directly or view it on GitHubhttps://github.com/msmhq/msm/issues/328#issuecomment-181914409.

derrickmehaffy commented 8 years ago

Yeah I would be, working on trying to keep access to the server as limited as possible but not over complicate it. I'd love to take a look. On Feb 9, 2016 8:37 AM, "Bent Terp" notifications@github.com wrote:

Yes it is only for running the msm commands without password prompt.

I did another wrapper called msh which basically gives a shell as the minecraft user, intended to be used when downloading plugins and editing configuration files. Can upload if you are interested.

Regards, Bent

Sent from my Sony Xperia™ smartphone

---- derrickmehaffy wrote ----

Excellent, just to be clear, none of the other users require sudo correct? And this only effects the msm command not if they edit any of the files under the msm storage (Such as plugin configs)

I dont see anything about edits but just wanted to check.

— Reply to this email directly or view it on GitHub< https://github.com/msmhq/msm/issues/328#issuecomment-181914409>.

— Reply to this email directly or view it on GitHub https://github.com/msmhq/msm/issues/328#issuecomment-181917395.

bentterp commented 8 years ago

[bent@tux2 ~]$ cat /usr/local/bin/msh

!/bin/bash

if test whoami = "minecraft" ; then /bin/bash -l else pushd ~minecraft >&/dev/null sudo -u minecraft /bin/bash -l popd >&/dev/null fi

[bent@tux2 ~]$ sudo cat /etc/sudoers.d/msm %minecraft ALL = (minecraft) NOPASSWD: /etc/init.d/msm *, /bin/bash

Basic, but gets the job done: [bent@tux2 ~]$ msh [minecraft@tux2 ~]$ whoami minecraft [minecraft@tux2 ~]$ pwd /opt/msm [minecraft@tux2 ~]$ exit logout [bent@tux2 ~]$