I look around the forum for answers.
I have 3 users, "user1" ,"user2", "user3":
- user1 : is sudo user with most of the access
- user2 : is also sudo user with less access
- user3 : is just another user with no sudo access
Im trying to give access to partitions 1 and 2 to user1, user2 and user3 .
The owner of the partition is root.
the partitions are mounted at
/media/user2/1
/media/user2/2
Note : I tried to mount the partition using
sudo mkdir /media/IntHDD170
sudo mkdir /media/IntHDD171
Which created the directory to mount the partitions.
- (I dont know this worked or not)
Step 1:
- Used nautilus as root.
- if nautilus is not installed:
sudo apt-get install nautilus
- Before running nautilus make sure the partition or hard disk is mounted.
Run nautilus as root with
sudo nautilus
Your partition or hard disk should appear on the left.
Right click on it -> select "Properties"
In the new window that appears, select the "Permissions" tab.
Kept the owner as "root" and group as "user1" with read and write access for both owner and group.
From here you can change the owner if you need to, as well as the permission for a certain user, root, or others.
Note: The user1 ,user2 and user3 did not get access to the partitions yet
Step 2: Added User2 and user3 to group "user1".
usermod -aG user1 user2
usermod -aG user1 user3
Step 3:
Did
chmod -R 777 /media/user2/1
chmod -R 777 /media/user2/2
opened
sudo nano /etc/fstab
Went to the last line entered:
LABEL=/dev/sda3 /media/$USER/1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
LABEL=/dev/sda4 /media/$USER/2 auto nosuid,nodev,nofail,x-gvfs-show 0 0
Saved and Exited
Note: Now i am able to read and write files to the partitions 1 and 2.
Only issue is, if i have logged into user1 , then try to access partition 1 from user2 , it is not accessible.
I do a reboot:
sudo reboot
And access partition 1 from user2.
I don't know if this is the right way to do it. Just combined many responses and did. Somehow its working.