Linux / Unix

Grant write permissions to multiple users on a folder in Ubuntu

Create a new group like “DevOps” and add the desire users to the group.

sudo groupadd devops

Now since group is created, let’s add users to the group.

sudo usermod -a -G devops peter
sudo usermod -a -G devops jens

Now all that’s left is to set the permissions on the directory:

sudo chgrp -R devops /path/to/the/directory
sudo chmod -R 770 /path/to/the/directory

Now only these two members of the devops group can read, write, or execute anything within the directory. Note the -R argument to the chmod and chgrp commands: this tells them to recurse into every sub directory of the target directory and modify every file and directory it finds.

Author: Danyal
I'm skilled programmer with expertise in Vue.js/Nux.js for front-end development and PHP Laravel for back-end development. I excel in building APIs and services, and also have experience in web server setup & maintenance. My versatile skill set allows you to develop and maintain web applications effectively, from the user interface to the server-side functionality. I love coding with never ending learning attitude, thanks for visiting danya.dk