• I've tried resetting the permissions on the folder:
    campadmin@camp-friendship:~/nodebb$ ls -l ./
    total 252
    -rwxrwxrwx 1 campadmin campadmin 11789 May 26 03:54 app.js
    -rwxrwxrwx 1 campadmin campadmin 662 May 26 03:54 bcrypt.js
    -rwxrwxrwx 1 campadmin campadmin 264 May 26 18:15 config.json
    -rwxrwxrwx 1 campadmin campadmin 3453 May 26 03:54 CONTRIBUTING.md
    -rwxrwxrwx 1 campadmin campadmin 2146 May 26 03:54 Gruntfile.js
    drwxrwxrwx 3 campadmin campadmin 4096 May 26 03:54 install
    -rwxrwxrwx 1 campadmin campadmin 35147 May 22 15:14 LICENSE
    -rwxrwxrwx 1 campadmin campadmin 6583 May 26 03:54 loader.js
    drwxrwxrwx 2 campadmin campadmin 4096 May 29 13:22 log
    drwxrwxrwx 2 campadmin campadmin 4096 May 26 03:39 logs
    -rwxrwxrwx 1 campadmin campadmin 1538 May 26 03:54 minifier.js
    -rwxrwxrwx 1 campadmin campadmin 3324 May 26 03:54 nodebb
    -rwxrwxrwx 1 campadmin campadmin 2361 May 22 15:14 nodebb.bat
    drwxrwxrwx 74 campadmin campadmin 4096 Jun 27 18:36 node_modules
    -rwxrwxrwx 1 campadmin campadmin 126678 May 26 03:54 npm-shrinkwrap.json
    -rwxrwxrwx 1 campadmin campadmin 2747 May 26 03:59 package.json
    drwxrwxrwx 2 campadmin campadmin 4096 May 29 13:36 pid
    drwxrwxrwx 10 campadmin campadmin 4096 Jun 27 18:52 public
    -rwxrwxrwx 1 campadmin campadmin 5376 May 26 03:54 README.md
    drwxrwxrwx 18 campadmin campadmin 4096 May 26 03:54 src
    drwxrwxrwx 4 campadmin campadmin 4096 May 26 03:54 tests

    Here's the error log: http://pastebin.com/rqCrpiUv

  • Gamers

    Having exact same issue. I think PM2 caused mine because it didn't happen before..


  • I'm not using PM2

  • Gamers

    Did you start NodeBB as root before?


  • As in have I ever? Yes, it's the only way I can get it to start. But it's not a file permission issue I think.

  • Gamers

    Yeah, not either. Exact same logs as your. Both error log and permission log.


  • Hmm guess we'll have to wait for someone who knows their stuff to show up 😆

  • Gamers

    Sadly, this forum is not really active comparing to other forums I use... 😞


  • True, but I've found that the guys who are on here tend to be helpful and know the code well, they're the devs lol


  • Try running:
    chown -R user:group DIRECTORY/

    Replace user and group with your specific user and group and DIRECTORY with your directory.

    On Ubuntu Server it would be:
    chown -R www-data:www-data forum/


  • Already done that, as well as chmod. Permissions are in the first post. I can run it again when I get home, but it should be the same.


  • What is the issue anyway to run nodeBB as root?

    It shouldn't be any kind of vulnerability.
    As long as you have the general security standards applied (ClamAV, SSH Port changed, direct root login disabled, 32 digit password for Redis) you have nothing to worry about.

    Except you have HTML code enabled for your forum. The warning regards it isn't there just for fun. Trust me.


  • I was under the impression that running it as root was a bad idea. It's the only thing on the server so I do agree it shouldn't be that big of a deal. I'm not sure which of those security settings are implemented, but I'll check and try to get them all in. HTML in Markdown settings is disabled, is this what you were referring to?
    Screenshot_2015-06-27-19-09-52.png


  • Yep.

    However, you have created a password for Redis?
    If not, do you want a few instructions?


  • I don't think I have. If you don't mind, please do show me how.


  • The commands below might vary from OS to OS. However, I will show them for Ubuntu Server.

    1.Set up a Redis Server password:
    First thing you want to do is to open the redis.conf in /etc/redis.
    Search for this line:
    # requirepass foobared

    And uncomment it, just like replace the password with yours, e.g.:
    requirepass MyPassword123

    Now simply enter:
    service redis restart

    Lastly you want to edit the config.json file in your nodeBB installation directory, where you insert it as well. Restart nodeBB to be sure the changes have been fully applied.

    Next we want to disable the direct root login.
    You may ask why. Imagine this scenario:
    Someone manages to access your server. But not only with basic permissions. Now he can do whatever he likes...

    So we do not want that.

    First step is to create a user by using:
    useradd YOURUSER
    and afterwards
    passwd YOURUSER

    Set a password you like.
    Now open /etc/ssh/sshd_config and check for a line like this:
    Port 22

    Change it to something random and unused on your server. This sort of "custom" number is also a little extra to add slight security. Be sure to connect to your chosen port then, instead of 22 as before.
    Afterwards go to
    #PermitRootLogin no

    and uncomment it.
    Now restart SSH, by using
    service sshd restart

    To login in as root again, either use sudo su and entering your users password or su -.
    I only showed you what is possible without extra software, if you want to have a look at Fail2Ban & ClamAV.

  • Community Rep

    @adriangb said:

    As in have I ever? Yes, it's the only way I can get it to start. But it's not a file permission issue I think.

    Can you run anything on nodejs as a non-root user? it might be how you installed node...


  • @AOKP Thanks so much. I was able to do both, and I don't think I'll need the AV software. This is a small private forum for <200 users with no real valuable (personal) info, just stuff that we don't want to be on Facebook and whatnot, so I doubt the added security is worth the trouble.

    The only issue I had was with the service commands to restart the services, both fail with the same error: "Failed to restart xxxx.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files". I believe this may be because that verbage is for Upstart, and since I'm using Ubuntu 15.04 I should be using systemd? In fact, that's the next thing I wanted to fix with my forum, getting a reliable autostart/autorestart solution going. I tried to configure systemd but it won't work.

    Here's what currently happens after booting the server and running nodebb log (no other commands):

    29/6 01:42 [1006] - info: Time: Mon Jun 29 2015 01:42:44 GMT-0400 (EDT)
    29/6 01:42 [1006] - info: Initializing NodeBB v0.7.0
    29/6 01:42 [1006] - error: Error: Redis connection to 127.0.0.1:6379 failed - co nnect ECONNREFUSED
    at RedisClient.on_error (/home/campadmin/nodebb/node_modules/redis/index.js: 185:24)
    at Socket.<anonymous> (/home/campadmin/nodebb/node_modules/redis/index.js:95 :14)
    at Socket.EventEmitter.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:415:13)
    3 restarts in 10 seconds, most likely an error on startup. Halting.

    And if I run campadmin@camp-friendship:~/nodebb$ ./nodebb start
    I get:

    Starting NodeBB
    "./nodebb stop" to stop the NodeBB server
    "./nodebb log" to view server output
    campadmin@camp-friendship:~/nodebb$ ./nodebb log
    NodeBB v0.7.0 Copyright (C) 2013-2014 NodeBB Inc.
    Clustering enabled: Spinning up 1 process(es).
    29/6 01:43 [781] - info: Time: Mon Jun 29 2015 01:43:42 GMT-0400 (EDT)
    29/6 01:43 [781] - info: Initializing NodeBB v0.7.0
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-calendar] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-calendar] In the event of an unr esponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb-plugin -calendar".
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-soundpack-default] This plugin m ay not be compatible with your version of NodeBB. This may cause unintended beha viour or crashing.
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-soundpack-default] In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset plugin="node bb-plugin-soundpack-default".
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-assign-newuser-to-group] This pl ugin may not be compatible with your version of NodeBB. This may cause unintende d behaviour or crashing.
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-assign-newuser-to-group] In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset plugin ="nodebb-plugin-assign-newuser-to-group".
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-dbsearch] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-dbsearch] In the event of an unr esponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb-plugin -dbsearch".
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-mentions] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-mentions] In the event of an unr esponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb-plugin -mentions".
    29/6 01:43 [781] - warn: [plugins/nodebb-widget-essentials] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour o r crashing.
    29/6 01:43 [781] - warn: [plugins/nodebb-widget-essentials] In the event of an u nresponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb-widg et-essentials".
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-buttons-galore] This plugin may not be compatible with your version of NodeBB. This may cause unintended behavio ur or crashing.
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-buttons-galore] In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb- plugin-buttons-galore".
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-markdown] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-markdown] In the event of an unr esponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb-plugin -markdown".
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-emoji-extended] This plugin may not be compatible with your version of NodeBB. This may cause unintended behavio ur or crashing.
    29/6 01:43 [781] - warn: [plugins/nodebb-plugin-emoji-extended] In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb- plugin-emoji-extended".
    29/6 01:43 [781] - warn: [plugins/nodebb-theme-persona] This plugin may not be c ompatible with your version of NodeBB. This may cause unintended behaviour or cr ashing.
    29/6 01:43 [781] - warn: [plugins/nodebb-theme-persona] In the event of an unres ponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb-theme-pe rsona".
    29/6 01:43 [781] - warn: [plugins.reload] Library not found for plugin: nodebb-t heme-persona
    29/6 01:43 [781] - info: NodeBB Ready
    29/6 01:43 [781] - info: Enabling 'trust proxy'
    29/6 01:43 [781] - info: NodeBB is now listening on: 0.0.0.0:3000


  • @BDHarrington7 said:

    Can you run anything on nodejs as a non-root user? it might be how you installed node...

    You'll have to give me a little more detail on how to test this or fix it, since I'm not 100% sure what you mean. I followed the Wiki's guide for Ubuntu Server I believe.

    And can someone give me 3 reputation points please? I have a 10 minute limit between posts, and with my lack of knowledge, I won't be able to help people enough to actually earn them anytime soon haha.

  • Community Rep

    have you experienced something like this: http://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo

    I wish I could remember the steps that caused the same issue where I couldn't run things on node unless I was root, I'm sure somewhere along the way I tried to fix it by changing permissions (which isn't something you should have to do unless you really know what you're doing). In the end I re-installed node and npm making sure I did not use sudo

Suggested Topics

  • 6
  • 10
  • 1
  • 3
  • 10
| |