You are not logged in.

#1 2011-05-29 13:04:47

HauntedGhost
Member
From: India
Registered: 2011-03-24
Posts: 5
Website

Changing access permissions of /mnt/x v/s using umask in /etc/fstab

I have three systems installed on my machine : Archlinux + Ubuntu + Windows7..
Recently I snatched all the space, except that used by "Program Files", from Windows, and created an ext4 partition, intending to share it between Ubuntu and Arch.
I have set up the mount points of that partition at a directory /mnt/dark-fort (I tend to keep names like that tongue).
I have also written the requied mount entry in /etc/fstab.
The entry is as follows :

# ext4 partition shared by ubuntu and archlinux
/dev/sda10      /mnt/dark-fort          ext4    user,exec,auto,rw,async,nodev   0       1

Now I want that a normal user should be able to read as well as write on that partition. But, with these settings, the system allows only the root to write on the partition.
After doing some searches, I found two solutions :
1. change the access permissions in /mnt/ so that it can be accessed by anyone.
2. insert appropriate umask entries in /etc/fstab.

I think that the first will make the system less secure. But again somewhere I read that using umask may not work (dont know the reason..I may be wrong here..).
So please guide me to the best solution. Note that I would prefer to keep the mount point in /mnt/ only.


Haunted.Ghost

Offline

#2 2011-05-29 14:24:43

lukaszan
Member
Registered: 2011-05-05
Posts: 117

Re: Changing access permissions of /mnt/x v/s using umask in /etc/fstab

umask will affect the files and directories on the filesystem (so inside dark-fort), not the folder itself. Besides, you won't be able to use it on ext4 filesystem, because it's already got all the permissions set, it's only used for systems like fat or ntfs which do not have support for permissons/ownership.

The only way then is to change permissions of /mnt/dark-folder. Unless you do something silly (like umask=000) there shouldn't be any security issues.

Offline

#3 2011-05-29 19:34:44

HauntedGhost
Member
From: India
Registered: 2011-03-24
Posts: 5
Website

Re: Changing access permissions of /mnt/x v/s using umask in /etc/fstab

lukaszan wrote:

umask will affect the files and directories on the filesystem (so inside dark-fort), not the folder itself. Besides, you won't be able to use it on ext4 filesystem, because it's already got all the permissions set, it's only used for systems like fat or ntfs which do not have support for permissons/ownership.

The only way then is to change permissions of /mnt/dark-folder. Unless you do something silly (like umask=000) there shouldn't be any security issues.

So I just change the access permissions of /mnt/dark-fort. and dont mention anything about umask in /etc/fstab. Alright with this?


Haunted.Ghost

Offline

#4 2011-06-03 05:37:26

HauntedGhost
Member
From: India
Registered: 2011-03-24
Posts: 5
Website

Re: Changing access permissions of /mnt/x v/s using umask in /etc/fstab

ok..So what I did was :
1. I created a user with same username 'hauntedghost' and id (1000) in both ArchLinux and Fedora.
2. created a group 'darkfortgroup', again with same name and id, in both the systems.
3. added the user as well as root to the group.
4. changed the group of /mnt/dark-fort to darkfortgroup.
5. assigned rwx permission to group in /mnt/dark-fort.

So far its all working good. I hope I did it the right way.


Haunted.Ghost

Offline

#5 2011-06-03 06:25:26

lukaszan
Member
Registered: 2011-05-05
Posts: 117

Re: Changing access permissions of /mnt/x v/s using umask in /etc/fstab

HauntedGhost wrote:

ok..So what I did was :
1. I created a user with same username 'hauntedghost' and id (1000) in both ArchLinux and Fedora.
2. created a group 'darkfortgroup', again with same name and id, in both the systems.
3. added the user as well as root to the group.
4. changed the group of /mnt/dark-fort to darkfortgroup.
5. assigned rwx permission to group in /mnt/dark-fort.

So far its all working good. I hope I did it the right way.

Sounds about right.

A couple of things:
1. Adding root to the group is unnecessary. Root's got all the privileges by default.
2. Since you are using the same username and id, the group doesn't have any effect, unless you have more users you want to access the folder. If not, it might be worth setting standard mask 644 (rw r r).

Offline

#6 2011-06-03 07:22:57

HauntedGhost
Member
From: India
Registered: 2011-03-24
Posts: 5
Website

Re: Changing access permissions of /mnt/x v/s using umask in /etc/fstab

lukaszan wrote:

Sounds about right.

A couple of things:
1. Adding root to the group is unnecessary. Root's got all the privileges by default.
2. Since you are using the same username and id, the group doesn't have any effect, unless you have more users you want to access the folder. If not, it might be worth setting standard mask 644 (rw r r).

ok..yes I am aware of what you are telling. I made the group keeping in mind the possibility that I may add another user (like a friend) and he would want access to that partition (as it has the publicly accessible data). So no issues on that smile
And I thanks for pointing me about the root. It didnt struck me at that time. Now it makes sense. smile


Haunted.Ghost

Offline

Board footer

Powered by FluxBB