Change owner right of folder

after create required folder /var/mongod/db i use this command chown vagrant:vagrant /var/mongod/db to switch owner ship but not sucessful

You need…

  1. sudo to change ownership from root to the vagrant user
  2. -R option to apply the changes to sub directories
  3. to do it at the mongod directory level, i.e. /var/mongod

that means we should type (at home)
sudo chown root:vagrant var/mongod

sudo chown -R vagrant:vagrant /var/mongodb

NB: Remember that the first slash is very important for these labs. And I think that the folder is called mongodb and not mongod so I’ve changed it for you.

i still got error

Remember what I reminded you about… this also applies to creating (mkdir) the directory.

1 Like

I have fixed this thanks a lot

Closing this thread as the issue has been resolved.