You are not logged in.

#1 2025-01-05 09:26:44

Nipun_Drall
Member
Registered: 2024-12-12
Posts: 9

[SOLVED] Create a group and set hard disks access to specific users.

Hello Everyone,

I've a pc with 4 hard disk in  it {1 boot disk and 3 storage disk}. And this pc have 5 users in it.
The problem i'm having is that i want to allow only specific users to allow access to specific hard disk.  I know that i can achieve this by creating a group and adding specific users to the groups according to their authorization.

But i don't know how to actually do this. And set hard disks to be accessible by users in a group.

Any help or guidance would be very appreciated

Last edited by Nipun_Drall (2025-01-12 08:39:59)


Just Google Me

Offline

#2 2025-01-05 11:39:59

Bollan
Member
Registered: 2025-01-05
Posts: 3

Re: [SOLVED] Create a group and set hard disks access to specific users.

Hello,

Do these five users have sudo/root priviliges? If not, you could simply create a folder for each disk/user and setup the correct privileges to these folders by the user group.
# create a folder for each disk
mkdir /mnt/disk1
chown root:accessgroup1 /mnt/disk1

then add the mountpoint for the disk/partition to fstab. This will mount all the disks at every startup of the system, but the mounted disks will only be accessible by sudo/root and their respective user.

Offline

#3 2025-01-06 06:41:40

Nipun_Drall
Member
Registered: 2024-12-12
Posts: 9

Re: [SOLVED] Create a group and set hard disks access to specific users.

Thanks you for Replying,

Do these five users have sudo/root priviliges? If not, you could simply create a folder for each disk/user and setup the correct privileges to these folders by the user group.

I've tried doing the same but the part i'm stuck at is, How do i add privilages for these folders to group.

mkdir /mnt/disk1
chown root:accessgroup1 /mnt/disk1

then add the mount point for the disk/partition to fstab. This will mount all the disks at every startup of the system, but the mounted disks will only be accessible by sudo/root and their respective user.

I've done this part and the sudo users are able to access the file and normal user aren't. I've added them to a group and then used chown with the command you suggested.  But the group users aren't allowed to access files. The error say

 You don't have enough permissions to view contents of the disk

Like how do i tell linux that the owner of this folder is this group and the group members can execute these files. {I know it can sound silly but My mind isn't working}.


Just Google Me

Offline

#4 2025-01-12 08:39:23

Nipun_Drall
Member
Registered: 2024-12-12
Posts: 9

Re: [SOLVED] Create a group and set hard disks access to specific users.

ok Got It. You Have to just change the Permisions of those Files. I found a Video Tutorial for the same.

Thanks For Helping


Just Google Me

Offline

Board footer

Powered by FluxBB