Mongo unsafe world

I am extremely new to using terminal commands. I am trying to run an application locally on my Mac and I am having difficulty doing it, so I am trying to pick out the possible problems. The first is when using the mongod command. I am getting the error

/ usr / local / bin / mongod: 3: warning: unsafe writing world dir / usr / local to PATH, mode 040777 all weekend will be: /usr/local/var/log/mongodb/mongo.log

Does this seem like a problem or a bug?

+3


source to share


1 answer


Having the / usr / local world writable is never a good idea. Normal permissions allow the superuser (root) to write to these system directories.

To get you closer to the default launch:

sudo chmod 755 /usr/local

      

Alternatively, you can clear the world write bit for each subdirectory and file by running:

sudo chmod -R o-w /usr/local

      

This means that you either need to run mongod as root, or change the database path somewhere you can write (for example, in your homedir).



I am running mongod on my development machine using the following command:

mongod --bind_ip 127.0.0.1 --dbpath ~/mongo -v --profile 2

      

This means the following:

  • --bind_ip 127.0.0.1

    make sure no other users on your network can access your database.
  • --dbpath ~/mongo

    save database files in home directory under mongo directory
  • -v

    show requests in progress
  • --profile 2

    shows information about performance and profiles on demand

You must run mongod -h

to see all available options.

+1


source







All Articles