Help running server with a non-root user: linux

Discussion in 'Bukkit Help' started by ukballer1012, Jan 29, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    ukballer1012

    I know this is probably the wrong category to post in but I really need help with this and I'm sure there are bound to be more people on here that can help me compared to other places I've posted about this. Okay, I've been running a server for a couple of months now with very little linux experience. I'm using ubuntu 11.4 (because it's more user friendly from what I hear) on my VPS. I've heard that you never want to run the server as a root and I'm having a lot of trouble trying to get this going. Can someone tell me what I have to do in order to run it as a non-root user that has permissions though? I've had this issue for 2 weeks now and my server has been down ever since. The lack of help is frustrating so I'll deeply appreciate any help I can get. Thanks in advance!
     
  2. Offline

    tyzoid

    Navigate to the directory that your craftbukkit.jar is in (or similarly named bukkit jarfile)

    Eg: /var/bukkit (probably not the actual location, but just an example.)

    once you are in the directory,

    Type:
    Code:
    cd ..
    sudo chown <username> <directory> -R
    chmod 755 <directory> -R
    
     
  3. Offline

    ukballer1012

    And this will grant whichever user full permission to interact fully within those folders? Also, could you tell me why it's recommended you don't run as root? I know it has something to do with security but what exactly?
     
  4. Offline

    tyzoid


    chown stands for CHange OWNer

    this will change the ownership over to <username>.

    chmod allows you change file permissions.
    In this case, the permissions 755 means
    owner:read/write/execute
    group:read/execute
    others:read/execute

    To be most secure, you'd want 750 as your permissions, but 755 allows apache or php to gain read only access to the files (if you have a web script by one of the plugins)

    In answer to you root question:
    The problem with running the server as root, is that you also allow all the plugins to run as root. While this may be fine for people who only run plugins by trusted authors, such as sk98q, or nijijokun, authors such as me could insert code that will be malicious to the server you run if it is root.

    By not running your server as root, you disable access of plugins to sensitive areas of the server that it shouldn't be accessing anyway.
     
  5. Offline

    tyzoid

    I haven't been on skype much, and you said you had another question.

    If you have some time, could you describe your question here? I will be able to get to it faster if you do.
     
  6. Offline

    ukballer1012

    I learn more from experience so I'd prefer if you could help me set it up and we could chat live in skype. I could share my screen or something like that. I'd like to get this done today.
     
  7. Offline

    tyzoid

    Ok. Just for everyone reading this, the solution was these commands:
    Code:
    cd /path/to/minecraft/
    cd ..
    sudo chown <username>:<username> minecraft/ -R
    chmod 775 minecraft/ -R
    
     
Thread Status:
Not open for further replies.

Share This Page