Skip to content
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

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

Open
bentterp opened this issue Feb 6, 2016 · 4 comments
Open

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

bentterp opened this issue Feb 6, 2016 · 4 comments

Comments

@bentterp
Copy link

bentterp commented Feb 6, 2016

[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
Copy link

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
Copy link
Author

bentterp commented Feb 9, 2016

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//issues/328#issuecomment-181914409.

@derrickmehaffy
Copy link

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
#328 (comment).

@bentterp
Copy link
Author

[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 ~]$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants