1

Problem

I need to give read/write access to a system group called "mongodb" on a USB key that's been formatted as ext4. It seems that the command worked, but when I try to have the system user write to this folder, I get a permissions error:

2014-11-11T10:41:19.326-0500 [initandlisten] exception in initAndListen std::exception: boost::filesystem::status: Permission denied: "/media/me/mongotest/mongodb", terminating

Here's the command I used to check that this group has access:

me@medev:~$ getfacl /media/me/mongotest/mongodb/
getfacl: Removing leading '/' from absolute path names
# file: media/me/mongotest/mongodb/
# owner: root
# group: root
user::rwx
group::r-x
group:mongodb:rwx
mask::rwx
other::r-x

Additional Test

Just to prove it was working, I did the following:

  1. create a new user in ubuntu called "test".
  2. created a new group called testers
  3. added test to testers.
  4. added testers to ACL list for /media/me/mongotest/mongodb folder on the usb:
 me@medev:~$ getfacl /media/me/mongotest/mongodb/
 getfacl: Removing leading '/' from absolute path names
 # file: media/me/mongotest/mongodb/
 # owner: root
 # group: root
 user::rwx
 group::r-x
 group:mongodb:rwx
 group:testers:rwx
 mask::rwx
 other::r-x
  1. Then I changed user to "test":
me@medev:~$ su test
Password:
  1. Tried to change directories into the USB key like so:
test@medev:/home/me$ cd /media/me/mongotest
bash: cd: /media/me/mongotest: Permission denied
test@medev:/home/me$ cd /media/me/mongotest/mongodb
bash: cd: /media/me/mongotest/mongodb: Permission denied
test@medev:/home/me$

So it would seem that I'm doing something wrong with the way I'm creating / adding these permissions... because it's failing for both users / groups.

2 Answers 2

0

I had to grant the ACL permissions on the /media/me folder. "me" is the name of my profile / username and I guess ubuntu mounts by default under my name. so this is what I did:

setfacl -m g:mondodb:rwx /media/me

And it works.

0

Always use a nonuser mount point. So mean a user (mongodb) cant write (me) other user files or links. If you delete "me" user creating a error of related user and services. When you give a folder more than 1 user, you make a cross link(s). Never a service offer you use a cross link.

***sorry for bad language..

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .