Docker Community Forums

Share and learn in the Docker community.

Usermod: Permission denied

Hi,
My website, on the docker (run Windows10).

I have a [public] directory and the website’s user put an image into the this directory.
I use the windows terminal >>> Ubuntu
$ ls -l
and Iget this response :

drwxrwxrwx 1 beginnerjdocker beginnerjdocker 4096 Apr 25 11:22 public
I think [beginnerjdocker] user must add into the [www-data] group

I tried two way but it doesn’t work :slight_smile:
adduser beginnerjdocker www-data

adduser: Only root may add a user or group to the system.

usermod -aG www-data beginnerjdocker

usermod: Permission denied.|
usermod: cannot lock /etc/passwd; try again later.

Could you help me : how I can do it ?

thanks

Following directory - permission denied in linux when creating a new user - Stack Overflow, I managed to add my user [beginnerjdocker] to the another group [www-data]

sudo adduser beginnerjdocker www-data

But I can not change the right to my directory, [public]

Nows, it is like this :

drwxrwxrwx 1 beginnerjdocker beginnerjdocker 4096 Apr 25 10:34 public

how can I get it like this :

drwxrwxrwx 1 beginnerjdocker www-data 4096 Apr 25 10:34 public

I tried it two different way like this:

sudo chown -R beginnerjdocker:www-data ./public
and all directory :
$ sudo chown -R beginnerjdocker:www-data .
But nothing is changed :unamused: