LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-17-2009, 03:44 AM   #1
oxymoron09
LQ Newbie
 
Registered: Jul 2009
Posts: 6

Rep: Reputation: 0
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!!

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!
 
Old 07-17-2009, 05:09 AM   #2
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
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.
 
Old 07-17-2009, 12:05 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

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

Last edited by jschiwal; 07-17-2009 at 12:07 PM.
 
Old 07-17-2009, 02:24 PM   #4
oxymoron09
LQ Newbie
 
Registered: Jul 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jschiwal View Post
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?
 
Old 07-18-2009, 05:59 AM   #5
oxymoron09
LQ Newbie
 
Registered: Jul 2009
Posts: 6

Original Poster
Rep: Reputation: 0
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.
 
Old 07-19-2009, 06:25 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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.

Last edited by jschiwal; 07-19-2009 at 06:27 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
auto mount home from network and login as user on Debian OS - tried /etc/fstab emma_m Linux - Software 3 07-16-2009 10:38 AM
Mounting/Permissions issue w/ external HDD enclosure (Debian) jef3189 Linux - Hardware 1 09-29-2008 04:41 PM
External HDD, mount points and permissions Niteskye Fedora 2 05-13-2006 05:42 PM
Heavy problems with mount and permissions in Debian bureado Linux - General 1 12-08-2003 12:04 AM


All times are GMT -5. The time now is 04:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration