0

I am running Ubuntu 20.04.1 LTS and having a problem where newly created user, added to group that owns a folder, can't create anything inside that folder. Did read online about this and followed all those instructions so it should work, but it doesn't.

$ sudo adduser bbpipeline
$ sudo usermod -G angular bbpipeline
$ sudo chmod g+rwx /home/angular
$ ls -l /home
drwxrwxr-x+ 7 angular     angular     4096 Jan 26 10:32 angular
$ su bbpipeline
$ mkdir /home/angular/backups
mkdir: cannot create directory ‘/home/angular/backups’: Permission denied
$ id
uid=1005(bbpipeline) gid=1005(bbpipeline) groups=1005(bbpipeline),1004(angular)

I did read that user must re-login and I did that ... with su and then closing terminal and opening it again and relogin. Still no joy. Do not have ACL and would prefer to keep things simple.

EDIT:

$ getfacl /home/angular
getfacl: Removing leading '/' from absolute path names
# file: home/angular
# owner: angular
# group: angular
user::rwx
group::r-x
group:isolated:---
mask::rwx
other::r-x

Started to explore further since @grifferz mentioned that I should check getfacl. It appears that there is ACL installed and that is managing users permissions too. Once I saw that, I executed:

$ getfacl -R /home/angular
$ sudo setfacl -m u:bbpipeline:rwx /home/angular

and now it's working. I can su bbpipeline and I can create new folder with that user inside /home/angular.

3
  • I deleted my answer because after following your steps above exactly, it worked fine for me on my Ubuntu 18.04 desktop, regardless of su bbpipeline vs su - bbpipeline. Are you absolutely sure that your question contains the exact steps you tried? I do note however that there is a '+' in your ls output for /home/angular which is not default. This means you already have a POSIX file ACL on it. You might want to do getfacl /home/angular to see what it is.
    – grifferz
    Jan 26, 2021 at 22:38
  • 100% sure. Even went to the length of deleting the server and re-creating it. Not sure if matters, server is a droplet on DigitalOcean. Have added getfacl and I am surprised that group does not have writing permissions. Jan 27, 2021 at 8:06
  • @grifferz You did direct me into the right direction! I didn't think that ACL is installed here, but would appear it was. I re-read my question and noticed that I forgot to mention that this is a Laravel Forge created droplet on DigitalOcean and it looks like the install ACL with the rest. Please add your comment about the getfacl tip as answer and I will accept it. Jan 27, 2021 at 8:32

1 Answer 1

0

The question shows:

$ ls -l /home
drwxrwxr-x+ 7 angular     angular     4096 Jan 26 10:32 angular

The '+' at the end there indicates that /home/angular has POSIX file ACLs on it.

Before the question was edited there was no mention of this, so I suggested that OP do a getfacl /home/angular to see if the ACLs were interfering, and this turned out to be the case.

The question has now been self-answered by OP after exploring the ACLs.

You must log in to answer this question.

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