- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Create a Shared Directory for All Users in Linux?
When multiple users need access to the same set of directories of files then we need to create shared folders to be used by the users. In Linux there is concept of users and groups which can be given certain level of permissions that will enable them to share the data. Below are the steps how to create the shared folders where users can and update the files individually.
Step 1 − Create the folder to be shared
Assuming we are setting up the shared folder from scratch, lets create the folder. The -p will create the directory and would ignore any errors if the directory already exists.
sudo mkdir -p /bigproject/sharedFolder
Step 2 − Create a user group
Next, we create a user group that will be used by users requiring access to this folder.
sudo groupadd SharedUsres
Step 3 − Create a user group
Next we create a user group which will be used by users requiring access to this folder.
sudo groupadd SharedUsres
Step 4 − Give permissions
Now we assign the new group to become owner of the shared folder and give them appropriate permissions which can also be inherited by the subdirectories.
sudo chgrp -R SharedUsers /bigproject/sharedFolder sudo chmod -R 2775 /bigproject/sharedFolder
Step 5 − Add users to the group
Now we add usernames to this group show that they can use the shared folder.
useradd -D -g SharedFolder user1 useradd -D -g SharedFolder user2
- How to list all users in a Linux group?
- How to create bulk users in the active directory using PowerShell?
- How to unzip all zipped files in a Linux directory?
- How to show all shared libraries used by executables in Linux?
- Checking create time for all users in SAP HANA
- How to create a new directory in Linux using the terminal?
- How to create a zip file and ignore directory structure in Linux?
- How to grep a string in a directory and all its subdirectories in Linux?
- How can I create directory tree using C++ in Linux?
- How to list all users who are currently logged into the Linux system?\n
- Copy a directory to an existing directory Linux?
- SQL Server Query to Find All Permissions/Access for All Users in a Database
- How to list the directory content in Linux?
- How to change the shell working directory in Linux?
- Move All Files Including Hidden Files Into Parent Directory in Linux