2
Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
In our support boards we aim to provide support for the B3 core in its current state. Older releases of B3 are NOT supported. Check our front page for the latest version. You may post feature requests in our General Discussion board. Modifications and Hacks of the core B3 code are NOT supported.
Before you ask for support: [ Read the Support Instructions ] - More info: [ Full Support Disclaimer ]

Author Topic: Running bot under different user on Linux  (Read 1000 times)

Offline HogensHero

  • Full Member
  • ***
  • Posts: 145
Running bot under different user on Linux
« on: April 13, 2014, 06:59:38 AM »
Hey guys,

I was just wondering if there is a way to run b3 under a different user than root on linux.  The bot starts using python which is owned by the root user thus the bot runs under root.  I was wondering if there was a way to run the bot differently as in a clan name or different user.

I am sure there are a couple of you guys that are a little more familiar with Linux than I am.

Thanks

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Running bot under different user on Linux
« Reply #1 on: April 13, 2014, 10:47:58 AM »
Quote
The bot starts using python which is owned by the root user thus the bot runs under root.
This statement is incorrect. You don't have to be root to run python programs

Quote
[email protected]:~/tmp$ ll /usr/bin/python
lrwxrwxrwx 1 root root 9 sept.  2  2013 /usr/bin/python -> python2.7*
[email protected]:~/tmp$ ll /usr/bin/python2.7
-rwxr-xr-x 1 root root 2807880 sept. 26  2013 /usr/bin/python2.7*
[email protected]:~/tmp$ # so the python program is owned by root
[email protected]:~/tmp$ whoami
thomas
[email protected]:~/tmp$ # now running python which user thomas
[email protected]:~/tmp$ python
Python 2.7.4 (default, Sep 26 2013, 03:20:26)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

Furthermore, you should try your best to not run any program (that does not require it) as root on your servers. And I indeed advise you not to run B3 as root ;)
« Last Edit: April 13, 2014, 10:49:40 AM by Courgette »

 


Rate this page +1 at Google Search

anything