LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 03-25-2003, 02:44 PM   #1
gauge73
Member
 
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420

Rep: Reputation: 30
Security and Permissions Questions


I have come up with a couple questions that are pretty basic that I need to have answered to further myself at all as a Linux user. I recently encountered an issue regarding permissions on my network and more specifically on my Linux server...

I have a hard drive that is mostly shared on my network at home. This drive is mounted at /mnt/network and has two subdirectories from there. One is data and the other is public. The data director is my personal files that I keep and use off of my Linux server. The public director is for general file sharing at LAN parties I host for my friends.

I wanted to share a file that was in my personal data directory by putting a link in the public directory. I did this, but only I was able to see the link in the public directory. It was invisible to all the rest of the users who were logged on the guest account (which only had access to the public directory.

Initially, the following folders and directories were owned by me and my personal group (which had no other members) with 750 permissions set...

/mnt
/mnt/network
/mnt/network/data
/mnt/network/data/software
/mnt/data/software/<the file I wanted to share>

and the following directory was given 777 permissions, and was owned by a LANparty group, which included the guest account...

/mnt/network/public (and all contents)

So, what I ended up doing was giving 775 access to all the files that were originally 750 and owned by me. This way they were able to see the link and read/execute the file over the network. This brought up the following questions for me:

1) In order to have access to a file/directory, do you have to have permissions to all the parent directories down to the root directory? Or can you access a directory if you do not have permissions on the parent directory?

2) Do all new files and directories take their permissions from their parent directory?

3) Is there a way to change default permissions when directories and files are created in a specific place?



Thanks a bunch for any help.
 
Old 03-25-2003, 03:07 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Quoting gauge73
1) In order to have access to a file/directory, do you have to have permissions to all the parent directories down to the root directory? Or can you access a directory if you do not have permissions on the parent directory?
Let's say if the user doesn't have read-permission to
some or all of the directories in the tree but has access
to a single file s/he has to specify the fully qualified name
of the file to access it.

Quote:
2) Do all new files and directories take their permissions from their parent directory?
Nope, they take it from umask. Do a man umask for
more information.

Quote:
3) Is there a way to change default permissions when directories and files are created in a specific place?
[/quote]
Yes, usually you'll want to modify umask for that.
To do it temporarily you can use the utility umask,
if you want it changed permanently (bad idea, the
default is very sensible!) edit /etc/profile and go
for umask there :)

For a good overview go here

Cheers,
Tink

Last edited by Tinkster; 03-25-2003 at 03:08 PM.
 
Old 03-25-2003, 10:04 PM   #3
gauge73
Member
 
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420

Original Poster
Rep: Reputation: 30
Thanks a bunch. That pretty much answers my questions.
 
Old 03-25-2003, 10:15 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally posted by gauge73
Thanks a bunch. That pretty much answers my questions. :)
Glad I could be of help! :}

Cheers,
Tink
 
  


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
security-access permissions kumary Linux - Newbie 7 12-03-2005 01:40 PM
[Security Questions] Last Login, how good is this feature for security breach info? t3gah Linux - Security 2 06-14-2005 01:02 AM
XFce Security/Permissions issue HenchmenResourc Linux - Software 1 02-02-2005 10:03 PM
Samba permissions - security = domain, help!!! Gustavo Gomes Linux - Networking 0 10-28-2003 06:28 AM
security opinion-program permissions Robert0380 Linux - Security 1 06-30-2003 06:43 AM


All times are GMT -5. The time now is 06:26 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