You are not logged in.

#1 2014-10-02 07:38:15

Janusz11
Member
Registered: 2007-05-16
Posts: 87

[SOLVED] Partition & Access for different users

Hey guys, I’m kind of lost and need some help.

Scenario:

My computer is set up with two hard drives: one SSD, which holds Arch and the /home folder, and a regular HDD, which holds the /var folder and where all data should go on two separate partitions.

Both partitions are mounted at /mnt/HDD2 and /mnt/HDD3.

Naturally, they both belong to root. However, since I want to be able to save all my music, games and whatnot on these two partitions I need to be able to access them as a normal user. On a single user system that would be a no-brainer; I would simply change the ownership. However, I plan to have another user use my computer from time to time and thus need to have the partitions accessible not only for one but a second user as well. And that’s where I can’t get things to work.

First I’ve changed the group for the partition (users) and added both users to the corresponding group (users) but could not write on the partition.

Then I’ve run chmod a+rxw on the partition. Beside the fact that I think that this is quite an inelegant solution, newly created folders where still only accessible by the corresponding user.

I’ve also set the SGID-Bit but no dice either.

Now I’m totally lost. Obviously, I’m missing something but I don’t see what.

tl;dr: I need access to a partition for different users on a single system so that they can easily save, write and share files between each other.

Any help appreciated.

Last edited by Janusz11 (2014-10-03 12:32:58)

Offline

#2 2014-10-02 12:22:54

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Partition & Access for different users


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2014-10-03 03:47:58

scryan
Member
Registered: 2014-07-01
Posts: 50

Re: [SOLVED] Partition & Access for different users

I haven't had to deal with multi-user setups, so forgive me if I am off base but shouldn't this just be a case of using the "user" option in fstab, then adding both users to a common group and giving that group access to the folders in question?

Offline

#4 2014-10-03 07:51:53

Janusz11
Member
Registered: 2007-05-16
Posts: 87

Re: [SOLVED] Partition & Access for different users

Hey scryan. The "user" option only means that a single user can mount (and unmount) that particular partition. But I'm perfectly fine with only root being able to mount (and unmount) the partitions. (They are both added to the system during boot by the way.)

*zap*

Problem meanwhile solved.

Last edited by Janusz11 (2014-10-03 12:32:30)

Offline

#5 2014-10-03 12:31:10

Janusz11
Member
Registered: 2007-05-16
Posts: 87

Re: [SOLVED] Partition & Access for different users

Problem solved.

I ended up using umask. It's basically a single user system anyway with a second user only using it from time to time and both of us having their own group. So it should be relatively save using umask.

I've changed the owner and group of the partition:

chown user1:group /mnt/HDD

...and the permissions:

chmod 2770 /mnt/HDD

...and added both users to the corresponding group of the partition:

gpasswd -a user1 group
gpasswd -a user2 group

Finally I've changed umask to 007 for each individual user while leaving the system-wide umask untouched.

Offline

Board footer

Powered by FluxBB