LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 03-11-2005, 02:52 PM   #1
guy24x
Member
 
Registered: Jan 2005
Location: Bangalore /India
Distribution: Mandrake 10.1 Official, Simply Mepis 3.3.1-1
Posts: 45

Rep: Reputation: 15
file system permissions problem


hi,

i am trying to access my 2nd hard disk (/dev/hdb) from linux. i have added the entry in fstab as follows:

/dev/hdb2 /mnt/win_i vfat rw,users,exec 0 0

the permissions for this filesystem are as follows (when i do a ls -l in /mnt)

drwxr--r-- 6 root root 4096 Jan 1 1970 win_i/

i changed the permissions as follows as root:

chmod 0755 win_i

i also tried chmod ugo+x win_i

but when i do an ls -l, i find the permissions have not changed. so i basically cant enter into win_i except as root.

what could be the reason?! i would appreciate it if someone could tell me whats going on or what i'm not doing right...

btw, is changing permissions for directories the same procedure as changing permissions for files?

thanx,
guy24x
 
Old 03-11-2005, 03:10 PM   #2
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
Let's start with defining the problem. You say you have "file permission problems," but you don't say what you are trying to achieve. That's like saying "I'm having a problem wth this map" without saying where you are trying to go.
 
Old 03-11-2005, 03:15 PM   #3
guy24x
Member
 
Registered: Jan 2005
Location: Bangalore /India
Distribution: Mandrake 10.1 Official, Simply Mepis 3.3.1-1
Posts: 45

Original Poster
Rep: Reputation: 15
basically, i'm trying to cd into the directory win_i so that i can read certain files (like mp3 files) within. however, i find that i can cd into win_i only as root, and not as a normal user.

the permissions for the parent directory (/mnt) are as follows:

drwxr-xr-x 10 root root 4096 Mar 9 18:05 mnt/

the error i get when i try to cd into win_i as a normal user are as follows:

[test@system1 mnt]$ cd win_i
bash: cd: win_i: Permission denied

regards,
guy24x

Last edited by guy24x; 03-11-2005 at 03:18 PM.
 
Old 03-11-2005, 04:09 PM   #4
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
try
Code:
# chmod -R 755 /mnt/win_i/
 
Old 03-12-2005, 01:02 AM   #5
guy24x
Member
 
Registered: Jan 2005
Location: Bangalore /India
Distribution: Mandrake 10.1 Official, Simply Mepis 3.3.1-1
Posts: 45

Original Poster
Rep: Reputation: 15
hi truck,

as u suggested, i tried:

[root@system1 mnt]# chmod -Rv 755 /mnt/win_i

and i did get the output that it changed the permissions of all files within win_i to 755, but when i do ls -l as a normal user, i still get the same status:

drwxr--r-- 6 root root 4096 Jan 1 1970 win_i/

and when i try to cd into win_i as a normal user, i get the same:

[test@system1 mnt]$ cd win_i
bash: cd: win_i: Permission denied

i unmounted win_i, deleted the directory win_i, and tried the procedure again as follows:

# umount /mnt/win_i
# rmdir win_i
#mkdir win_i

at this point, win_i has the 755 permissions.

immediately after i mount hdb2 onto win_i, the permissions change back to 744.

my umask value is 0022.

regards,
guy24x
 
Old 03-12-2005, 03:32 AM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You can't use the 'chmod' command on a mounted vfat partition. You need to use the umask= option instead. As an alternative, you can use the fmask= and dmask= options to give different permissions for files and directories. You probablly don't want files on this drive to be executable, so you could mask out the 'x' execution bit using fmask. However, the 'x' bit serves a different function for directories, so you would want it set.

Read through the 'man mount' man-page for all of the gory details!

There are other options you can use. For example, instead of the users option you can use 'uid=' and 'gid=' option. So if your username is 'guy24x' you could have 'uid=guy24x' as one of the options. This will make you the owner of the partition, and give you full access. If there is a 'guy24x' group also, you could use 'gid=guy24x'.

Something else you could do is create a group who's purpose is sharing this particular partition. Then making certain users members of the group would allow these users to share files there, but deny others access. This is what the group 'fileshare' is for. But you could create your own group.

Also, consider using the 'noexec' and 'nodev' option when mounting this drive.

Last edited by jschiwal; 03-12-2005 at 03:33 AM.
 
Old 03-12-2005, 04:38 AM   #7
guy24x
Member
 
Registered: Jan 2005
Location: Bangalore /India
Distribution: Mandrake 10.1 Official, Simply Mepis 3.3.1-1
Posts: 45

Original Poster
Rep: Reputation: 15
thank you so much jschiwal phewwwww

i was trying to figure out how to make this work for a month i guess !!!

as u mentioned, i did:

[root@system1 mnt]# mount -t vfat /dev/hdb2 win_i -o "uid=test"

and poof now i can enter win_i as a normal user (test)

thanx so much for the <timely> help

warm regards,
guy24x

(sometimes i think linux should be simpler to figure out ;-) the steep learning curve for newbies like me migrating from the m$ world gets pretty frustrating at times ! what do you feel?!)

Last edited by guy24x; 03-12-2005 at 04:40 AM.
 
Old 03-15-2005, 03:59 AM   #8
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
At least there is a lot of documentation available for linux. Look in the www.tldp.org website for tons of howto's and guides.

Also, go to the mcc software installer and search for 'document'. There is a lot there.

I find it convenient to view man-pages and info-pages in the browser. From the konqueror address bar, or the application launcher enter man:<topic> or info:<topic>

You might consider installing 'webmin'. You can even partition drives there. If it is installed, point your browser to https://127.0.0.1:10000

There is also a cups web interface: http://localhost:631

Suppose you wanted to print out a man-page for a subject that you need to study, or for reference. You can produce a postscript file that can be viewed in kghostview or printed out: man -t fstab >fstab.ps . I find such a format makes it easier to read and remember. Also, you can refer to the printed page will trying it out on the console.

I agree that improvements could be made in the documentation. For example, in the documentation for Cups, perhaps an example on how on which group membership to add and how to set the password, so that you can make changes. Perhaps the distro's could produce better under-the-hood documentation explaining how everything fits together.

There are some excellent book available.
"The Linux Cookbook: Tips and Techniques for Everyday Use" by Michael Stuts.
"Running Linux", O'Reilly

For console commands, look at the 'info coreutils' pages. Many of the common commands found in /bin are documented there. There were written as a group and so many of them have common options.

Well, take care. I hope some of these tips are helpful.
 
Old 04-07-2005, 06:09 PM   #9
guy24x
Member
 
Registered: Jan 2005
Location: Bangalore /India
Distribution: Mandrake 10.1 Official, Simply Mepis 3.3.1-1
Posts: 45

Original Poster
Rep: Reputation: 15
thank u so much jschiwal for the pointers...i will go thru more documentation b4 i crib that linux is tough!

thanx again,

guy24x

(p.s: sorry about the late reply)
 
  


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
how to restore the default file permissions (whole system) ? bbbb Linux - General 2 11-05-2005 04:10 AM
Advice: consistency in file system permissions tisource Linux - General 1 08-15-2005 06:15 PM
A slight problem with file permissions f0rk Slackware 4 07-26-2005 08:57 AM
Problems with system-wide file permissions hexadevil Linux - Newbie 2 05-30-2004 07:54 AM
File Permissions Problem sjb142 Linux - Networking 3 12-05-2003 06:25 PM


All times are GMT -5. The time now is 10:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration