LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-03-2016, 03:57 PM   #1
Hasek39
Member
 
Registered: Jul 2015
Location: Pittsburgh, PA, US
Distribution: Slackware
Posts: 116

Rep: Reputation: Disabled
Launch Minecraft and Minecraft server as non-root user


Hello everyone, I have a few questions about running Minecraft and Minecraft server as root and non-root user.

First of all in a few words let me tell about how I launch them now. I have an official Mojang account and downloaded Minecraft.jar and Minecraft_server.1.8.9.jar from an official site minecraft.net. I want Minecraft be at /usr/local/games/ and Minecraft server at /usr/local/games/minecraft_server/ so I moved them to wished path. I cannot access /usr/local/ path as non-root user (for example if run mkdir /usr/local/testdir the output will be "Permission denied") so I thought it is necessary to use sudo before commands java -jar /usr/local/games/minecraft.jar or java -jar /usr/local/games/minecraft_server/minecraft_server.1.8.9.jar when I want to launch the game or server. For the first time I launched them via sudo. But then I found that I can run minecraft.jar without sudo and it will work! But I can't run server without sudo because if I do that the server wouldn't be able to find and then to create file server.properties (I think because it hasn't permission to write at /usr/local/.../ path as non-root process) so it wouldn't work.

My questions are:
1. Is it possible to run Minecraft server at /usr/local/games/minecraft_server/ as non-root process maybe in any other way? It is obvious that if possible it is better to run any process as non-root.
2. If it isn't possible is it safe to run Minecraft server as root? I had to run it as root for about week ot two and there wasn't any troubles with it and my system in general but on the other web-sites I found quotes like "NEVER EVER RUN MINECRAFT SERVER AS ROOT!" or "NEVER! ever! run minecraft as root."
3. If, for example, it is possible is it safe for existing world on my server? Or will server launched without sudo overwrite existing files and create a new world? I don't want this because I play on server with my friends.
4. After installation Minecraft created /.minecraft and /.oracle_jre_usage directories at my user and root home directories. Is it safe just to remove /root/.minecraft and /root /.oracle_jre_usage? I understood that there are all saved games that I have played in singleplayer when used to launch Minecraft via sudo but can it cause any other problems? Will the game works after that just without saved worlds in singleplayer?

If it is important my distribution is GNU/Linux Slackware 14.1 and desktop environment is KDE 4.10.5.

Last edited by Hasek39; 01-03-2016 at 11:53 PM.
 
Old 01-03-2016, 04:26 PM   #2
Hasek39
Member
 
Registered: Jul 2015
Location: Pittsburgh, PA, US
Distribution: Slackware
Posts: 116

Original Poster
Rep: Reputation: Disabled
To moderators: can you please move my thread to Linux-Software/Linux-Games forum?
 
Old 01-03-2016, 07:43 PM   #3
jmgibson1981
Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 615

Rep: Reputation: Disabled
The minecraft server files go where the .jar file is. So wherever you want that .jar to be has to be writeable by the user.
 
Old 01-03-2016, 11:52 PM   #4
Hasek39
Member
 
Registered: Jul 2015
Location: Pittsburgh, PA, US
Distribution: Slackware
Posts: 116

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jmgibson1981 View Post
The minecraft server files go where the .jar file is. So wherever you want that .jar to be has to be writeable by the user.
So to be writeable by user it can only be somewhere in /home/user/ directory, am I right?
 
Old 01-04-2016, 03:06 AM   #5
Hasek39
Member
 
Registered: Jul 2015
Location: Pittsburgh, PA, US
Distribution: Slackware
Posts: 116

Original Poster
Rep: Reputation: Disabled
I have successfully solved my problem by changing the owner of server directory. This is how I did that:
Code:
sudo chown -hR $my_user_name$ /usr/local/games/minecraft_server/
I can run both Minecraft server and client as non-root user now.
 
  


Reply

Tags
games, minecraft


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Minecraft world trickery (and even minecraft on ipad) lhartvik LinuxQuestions.org Member Success Stories 2 05-28-2015 01:32 AM
[SOLVED] Minecraft server. Tadaen Linux - Server 2 07-25-2014 11:43 PM
LXer: GOL MineCraft Weekly. Grab Issue 2 Today, Linux Minecraft server LXer Syndicated Linux News 0 08-04-2013 11:41 AM
I need to change minecraft directory as root EODSteven Linux - Newbie 19 11-10-2012 07:14 AM
[SOLVED] 1337 Minecraft Server enorbet Slackware 4 03-20-2011 05:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration