LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   hdd mount permissions (fstab?) Debian lenny (https://www.linuxquestions.org/questions/linux-newbie-8/hdd-mount-permissions-fstab-debian-lenny-740696/)

oxymoron09 07-17-2009 02:44 AM

hdd mount permissions (fstab?) Debian lenny
 
Hi,

This is what I have done so far:

Code:

sudo addgrp media_write

sudo /etc/group

add dean,mediatomb (to media_write)

sudo chgrp media_write /mnt/storage1

sudo chmod 770 /mnt/storage1 -R

Then:

Code:

sudo chmod g=rwx /mnt/storage1/
sudo chmod g+s /mnt/storage1/

Here is my ftsab:

Code:

# /etc/fstab: static file system information.
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    defaults        0      0
/dev/hdb1      /              ext3    errors=remount-ro 0      1
/dev/hdb5      none            swap    sw              0      0
/dev/hdc        /media/cdrom0  udf,iso9660 user,noauto    0      0
/dev/sda1      /mnt/storage1  ext3    users,auto,rw 0 0
/dev/sdb1      /mnt/storage2  ext3    users,auto,rw 0 0

This is the only settings I can get to work atm, I just need 644 on my files when they are created on /mnt/storage1/ I just cannot seem to get it, I'm about to cry!! :p

Code:

ls -l
total 8
drwxrwsr-x 5 dean media_write 4096 2009-07-17 08:10 storage1
drwxrwxr-x 5 dean media_write 4096 2009-07-17 08:12 storage2

Please can someone help me!

eco 07-17-2009 04:09 AM

I'd have done...

Edit the group and shaddow group file
Code:

$ sudo vigr
$ sudo vigr -s

Set the permissions
Code:

$ sudo find /mnt/storage1 \( -type f -exec chmod 660 {} \; \) , \( -type d -exec chmod 770 {} \; \)
$ sudo chmod 02770 /mnt/storage1

Much the same but could be handy... check your shaddow file matches your group file.

jschiwal 07-17-2009 11:05 AM

The permissions are masked by your `umask' setting, after the file is created. Change it by putting:
umask 0002
in your ~/.profile script.

oxymoron09 07-17-2009 01:24 PM

Quote:

Originally Posted by jschiwal (Post 3610847)
The permissions are masked by your `umask' setting, after the file is created. Change it by putting:
umask 0002
in your ~/.profile script.

Thank you for your reply.

Unfortunetly I am still haveing problems. Adding umask=022 within /home/dean/.profile does nothing. All files I upload to /mnt/storage1/ still have only rw permissions.

What else do you suggest?

oxymoron09 07-18-2009 04:59 AM

I think I have been a muppet lol. I run vsftpd as an ftp server, I didn't realise that I needed to comment out #local_umask=022 lol.

This is why ftp always uploaded as rw I think.

How do I reset all permissions on /mnt/storage1 I have created quite a mess and think its best if i reset and have some sensible permissions of 644 throughout.

jschiwal 07-19-2009 05:25 AM

find /mnt/storage1 -type f -exec chmod 0644 '{}' \;
find /mnt/storage1 -type d -exec chmod 0755 '{}' \;

You can't simply use:
chmod -R 0644 /mnt/storage1/*
because that would remove the 'x' permission bit from directories. On directories, this allows you to cd into them. For files it marks them as executable.


All times are GMT -5. The time now is 05:55 PM.