You are not logged in.
The Title describes my Problem pretty good.
In my fstab-file I mounted a few partitions with
rw,auto,user
but I can still not write into them without using the sudo/su command. I have no Idea why.
Any suggestions?
Last edited by freebe (2015-11-12 21:14:03)
Offline
I believe you misunderstand the user option. It allows users to mount the partition but it has nothing to do with the permission to access files on the mounted partition. It does not make sense with the auto option because the auto option automatically mounts the partition. It is useful with the noauto option. The permissions depend of the filesystem. For Unix filesystems (like ext{2,3,4}), the permissions are set on the files and you will have to use chmod as usual. For a vfat file system, you can use the umask/fmask/dmask options (as well as uid, gid). To let anyone do anything with the mounted files, you can use umask=0000; see "man mount" for details.
Last edited by olive (2015-11-09 21:02:01)
Offline
Post your whole fstab
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Thanks for your replies!
My umask settings in /etc/profile where at 022, I changed them now to 027. I added the same umask to ~/.bashrc. The first number is for the current user, right? So I should have all the necessary permissions...
my fstab-file now:
# /dev/sdb1
UUID=blablabla / ext4 rw,relatime,data=ordered 0 1
# /dev/sdb3 LABEL=antiX15home
UUID=blablabla /home ext4 rw,relatime,data=ordered 0 2
# /dev/sdb2
UUID=blablabla none swap defaults 0 0
# /dev/sdc4
# /dev/sdc5 ext4
UUID=blablabla /media/crypt ext4 rw,user,exec 0 0
# /dev/sdc6 vfat
UUID=blablabla /media/box vfat rw,user,exec 0 0
# /dev/sdc7 ntfs
UUID=blablabla /media/winfiles ntfs-3g rw,user,exec 0 0
Last edited by freebe (2015-11-10 12:48:35)
Offline
I'm no expert on permissions, but I think the order is owner - group - other
So it makes more sense to me to give 777 permissions.
I think that with 027 you won't be able to access the folder as root. This could be useful, however, if you have a partition that could contain malicious software for instance.
Edit: perhaps you can try using default settings first (replace rw, user, exec with defaults) see if that works.
Last edited by LCvanDinteren (2015-11-10 13:22:44)
Offline
https://wiki.archlinux.org/index.php/NT … oup.2Fuser
https://wiki.archlinux.org/index.php/Fs … ormal_User
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Online
@ LCvanDinteren:
The umask values are the negated values of chmod, that means umask 777 is chmod 000. So with 777 the file would have no permissions to anyone.
@ WorMzy
Okay, that looks good. I didn't know I can set umask and gid/uid as options in the fstab. I'll try that!
Offline
@ LCvanDinteren:
The umask values are the negated values of chmod, that means umask 777 is chmod 000. So with 777 the file would have no permissions to anyone.
Oops! My bad.
But this means you gave even less permissions than it had before (removed wx on other), this makes no sense to me.
Maybe I have a naive approach, but I usually start debugging these kind of problems by starting with the most basic setup and see where it goes wrong as I apply my desired changes.
So in this case I would start by using default settings, umask 000, perhaps even try to mount manually in my home folder.
You say your umask is set on /etc/profile, have you also tried this?
umask -R 027 /mount
Offline
Yes, I reduced the permissions, because I do not want everyone to look at / excecute my files.
Adding umask as option for the fat-partition and gid+uid for the ntfs-partition solved the problem. I can now work with the partitions as if they were my home partition. This is how the two partitions look now on my fstab:
# /dev/sdc6 vfat
UUID=blablabla /media/box vfat user,rw,umask=000 0 0
# /dev/sdc7 ntfs
UUID=blablabla /media/winfiles ntfs-3g uid=freebe,gid=users,umask=0027 0 0
Thank you guys for helping!
The only thing I'm concerned about now ist that everyone can acces the fat partition now. Is that right?
When I tried it with umask 007, I couldn't access it as the user. It only works with umask 000.
@ LCvanDinteren:
You say your umask is set on /etc/profile, have you also tried this?umask -R 027 /mount
I didn't try that. Will try it at the next boot
Last edited by freebe (2015-11-10 17:43:20)
Offline
LCvanDinteren wrote:@ LCvanDinteren:
You say your umask is set on /etc/profile, have you also tried this?umask -R 027 /mount
I didn't try that. Will try it at the next boot
$ mkdir test
$ umask -R 027 test
bash: umask: -R: invalid option
umask: usage: umask [-p] [-S] [mode]
LCvanDintern did you try that command before you suggested it?
Offline
freebe wrote:LCvanDinteren wrote:@ LCvanDinteren:
You say your umask is set on /etc/profile, have you also tried this?umask -R 027 /mount
I didn't try that. Will try it at the next boot
$ mkdir test $ umask -R 027 test bash: umask: -R: invalid option umask: usage: umask [-p] [-S] [mode]
LCvanDintern did you try that command before you suggested it?
I'm sorry, it came straight from my Ubuntus history..
the idea was to set the permissions on the mount folder
try: (tested this..)
cd /mount
umask 027
Offline
I'm sorry, it came straight from my Ubuntus history..
the idea was to set the permissions on the mount foldertry: (tested this..)
cd /mount umask 027
The umask utility shall set the file mode creation mask of the current
shell execution environment (see Section 2.12, Shell Execution Environ‐
ment) to the value specified by the mask operand. This mask shall
affect the initial value of the file permission bits of subsequently
created files.
Note permissions for the current shell, it has no interaction with the file system.
Even if it was set global in for instance /etc/profile mount as provided by systemd does not use a shell so the value there would not be respected.
Also as a security measure any other user could simply change the value of the umask.
It does seem you are confusing the umask parameter in the options string passed to mount with the sehll built-in of the same name.
Offline
And how about chmod then? would something like chmod 750 /mount work?
Just blurting brainfarts here..
Offline
The only thing I'm concerned about now ist that everyone can acces the fat partition now. Is that right?
When I tried it with umask 007, I couldn't access it as the user. It only works with umask 000.
Assuming I understand correctly that should be mounted at /media/box.
What is the output of
$ls -lad /media/box
Edit:
And how about chmod then? would something like chmod 750 /mount work?
Covered by olive in post #2 of this thread.
Last edited by loqs (2015-11-10 19:29:49)
Offline
And how about chmod then? would something like chmod 750 /mount work?
[assuming you mean running chmod on the mountpoints]
No, because FAT and NTFS aren't UNIX permission-compatible (although you can use the "permissions" option to make ntfs-3g masquerade as though it is -- see the end of the ntfs-3g wiki page I linked above).
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Online
freebe wrote:The only thing I'm concerned about now ist that everyone can acces the fat partition now. Is that right?
When I tried it with umask 007, I couldn't access it as the user. It only works with umask 000.Assuming I understand correctly that should be mounted at /media/box.
What is the output of$ls -lad /media/box
The output is
drwxrwx--- 27 root root 65536 Jan 1 1970 /media/box
drwxrwxrwx 27 root root 65536 Jan 1 1970 /media/box
with umask 007 and umask 000 respectively
LCvanDinteren wrote:You say your umask is set on /etc/profile, have you also tried this?
umask -R 027 /mount
I didn't try that. Will try it at the next boot
I refrained from doing that, after reading the following replies.
Offline
The output is
drwxrwx--- 27 root root 65536 Jan 1 1970 /media/box drwxrwxrwx 27 root root 65536 Jan 1 1970 /media/box
with umask 007 and umask 000 respectively
So this shows it is owned by the user root and the group root.
With the 007 umask only the above have access.
With the 000 umask the above + other have access.
Given what you have said already it would seem you want to change the owning group or user the same way you did for the ntfs partition.
The user option as had already been noted seems odd here as the filesystem would be mounted at boot time as you have not specified noauto option.
So a user can not use that mount as it has already been mounted by root.
Offline
Wow, you left me thinking over your post a while...
Just today it clicked. I did the same to the vfat-partition... Just as you said. This is my fstab-file now:
# /dev/sdc6 vfat
UUID=blablabla /media/box vfat uid=freebe,gid=users,umask=0027 0 0
# /dev/sdc7 ntfs
UUID=blablabla /media/winfiles ntfs-3g uid=freebe,gid=users,umask=0027 0 0
The output of ls -lad /media/box is
drwxr-x--- 27 freebe users 65536 Jan 1 1970 /media/box/
So it is now owned by the user freebe and the group users
Now it works excactly how I want it to )
Thank you!!!
Offline